⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 learningswitchlayerfigure.java

📁 拥有图形界面的
💻 JAVA
字号:
/* * LearningSwitchLayerFigure.java * * Created on 30 aprile 2002, 17.02 */package org.joone.edit;import java.awt.*;import java.util.*;import CH.ifa.draw.standard.*;import CH.ifa.draw.figures.*;import org.joone.engine.*;import org.joone.util.LearningSwitch;import org.joone.io.*;/** * * @author  pmarrone */public class LearningSwitchLayerFigure extends InputLayerFigure {        private static final long serialVersionUID = -7060434046498637411L;        /** Creates a new instance of LearningSwitchLayerFigure */    public LearningSwitchLayerFigure() {    }        protected void initContent() {        fPostConn = new Vector();        fPreConn = new Vector();                Font fb = new Font("Helvetica", Font.BOLD, 12);                myInputLayer = (StreamInputSynapse)createLayer();                TextFigure name = new UpdatableTextFigure() {            public void setText(String newText) {                super.setText(newText);                getInputLayer().setName(newText);            }            public void update() {                setText(getInputLayer().getName());            }        };                name.setFont(fb);        name.setText("LearningSwitch " + ++numLayers);        name.setAttribute("TextColor", Color.blue);        add(name);    }        protected Vector addHandles(Vector handles) {        handles.addElement(new ConnectionHandle(this, RelativeLocator.east(),        new InputLayerConnection()));        handles.addElement(new SpecialConnectionHandle(this, RelativeLocator.north(),        new ValidationLayerConnection(), Color.red));        return handles;    }        public boolean addPreConn(LayerFigure layerFigure, InputPatternListener synapse) {        boolean ret = super.addPreConn(layerFigure, synapse);        LearningSwitch ls = (LearningSwitch)getInputLayer();        ls.addTrainingSet((StreamInputSynapse)synapse);        return ret;    }        public void addPreValConn(LayerFigure layerFigure, InputPatternListener synapse) {        super.addPreConn(layerFigure, synapse);        LearningSwitch ls = (LearningSwitch)getInputLayer();        ls.addValidationSet((StreamInputSynapse)synapse);    }            public void removePreConn(LayerFigure figure, InputPatternListener conn) {        this.removePreConn(figure);        LearningSwitch ls = (LearningSwitch)getInputLayer();        ls.removeTrainingSet();    }        public void removePreValConn(LayerFigure figure, InputPatternListener conn) {        this.removePreConn(figure);        LearningSwitch ls = (LearningSwitch)getInputLayer();        ls.removeValidationSet();    }    }

⌨️ 快捷键说明

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