📄 inputswitchlayerfigure.java
字号:
/* Generated by Together */package org.joone.edit;import java.awt.*;import java.util.*;import CH.ifa.draw.framework.*;import CH.ifa.draw.standard.*;import CH.ifa.draw.figures.*;import org.joone.engine.*;import org.joone.io.*;import org.joone.io.InputSwitchSynapse;public class InputSwitchLayerFigure extends InputLayerFigure { private static final long serialVersionUID = 2085660250757587640L; public InputSwitchLayerFigure() { } protected Vector addHandles(Vector handles) { handles.addElement(new ConnectionHandle(this, RelativeLocator.east(), new InputLayerConnection())); return handles; } protected void initContent() { fPostConn = new Vector(); fPreConn = new Vector(); Font fb = new Font("Helvetica", Font.BOLD, 12); myInputLayer = (InputPatternListener)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("InputSwitch " + ++numLayers); name.setAttribute("TextColor", Color.blue); add(name); } public boolean canConnect(GenericFigure start, ConnectionFigure conn) { return super.canConnect(start, conn); } public boolean addPreConn(LayerFigure layerFigure, InputPatternListener synapse) { boolean ret = super.addPreConn(layerFigure, synapse); InputSwitchSynapse iss = (InputSwitchSynapse)getInputLayer(); iss.addInputSynapse((StreamInputSynapse)synapse); return ret; } public void removePreConn(LayerFigure figure, InputPatternListener conn) { this.removePreConn(figure); InputSwitchSynapse iss = (InputSwitchSynapse)getInputLayer(); String sName = conn.getName(); iss.removeInputSynapse(sName); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -