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

📄 inputpluginlayerfigure.java

📁 拥有图形界面的
💻 JAVA
字号:
/* * InputLayerFigure.java * * Created on 2 aprile 2001, 1.17 */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.util.*;/** * * @author  pmarrone */public class InputPluginLayerFigure extends LayerFigure {        protected ConverterPlugIn myPlugin;        private static final long serialVersionUID = 3814306272962638219L;        /** Creates new InputLayerFigure */    public InputPluginLayerFigure() {    }        protected void initContent() {        fPostConn = new Vector();        fPreConn = new Vector();                Font fb = new Font("Helvetica", Font.BOLD, 12);                myPlugin = (ConverterPlugIn)createLayer();                TextFigure name = new UpdatableTextFigure() {            public void setText(String newText) {                super.setText(newText);                getPluginLayer().setName(newText);            }            public void update() {                setText(getPluginLayer().getName());            }        };                name.setFont(fb);        name.setText("InputPlugin " + ++numLayers);        name.setAttribute("TextColor", Color.blue);        add(name);    }        public void addPostConn(LayerFigure figure) {        if (!fPostConn.contains(figure))            fPostConn.addElement(figure);    }        public boolean addPreConn(LayerFigure layerFigure, InputPatternListener synapse) {        return false;    }    public void addPreConn(LayerFigure layerFigure, AbstractConverterPlugIn plugin) {        this.getPluginLayer().addPlugIn(plugin);        if (!fPreConn.contains(layerFigure)) {            fPreConn.addElement(layerFigure);        }    }        public void removePreConn(LayerFigure figure, AbstractConverterPlugIn plugin) {        fPreConn.removeElement(figure);        this.getPluginLayer().addPlugIn(null);    }        protected Vector addHandles(Vector handles) {        handles.addElement(new SpecialConnectionHandle(this, RelativeLocator.south(),        new InputPluginConnection(), Color.magenta));        return handles;    }        /** Get the InputLayer object     * @return the InputLayer object (org.joone.StreamInputSynapse)     */        public ConverterPlugIn getPluginLayer() {        return myPlugin;    }        public boolean canConnect() {        return true;    }        /** Returns the wrapper for the Figure     * @return the Wrapper object     */    public Wrapper getWrapper() {        return new Wrapper(this, getPluginLayer(), getPluginLayer().getName());    }        public boolean canConnect(GenericFigure start, ConnectionFigure conn) {        boolean retValue;                retValue = super.canConnect(start, conn);        if (!(conn instanceof InputPluginConnection))            retValue = false;        if (getPluginLayer().isConnected())            retValue = false;        return retValue;    }    }

⌨️ 快捷键说明

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