/* 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.*;
public class OutputSwitchLayerFigure extends OutputLayerFigure {
static final long serialVersionUID = 5673378683619182777L;
public OutputSwitchLayerFigure() {
}
protected Vector addHandles(Vector handles) {
handles.addElement(new ConnectionHandle(this, RelativeLocator.east(),
new LayerConnection()));
return handles;
}
protected void initContent() {
fPostConn = new Vector();
fPreConn = new Vector();
Font fb = new Font("Helvetica", Font.BOLD, 12);
myOutputLayer = (OutputPatternListener)createLayer();
TextFigure name = new UpdatableTextFigure() {
public void setText(String newText) {
super.setText(newText);
getOutputLayer().setName(newText);
}
public void update() {
setText(getOutputLayer().getName());
}
};
name.setFont(fb);
name.setText("Output Switch " + ++numLayers);
name.setAttribute("TextColor", Color.blue);
add(name);
}
public boolean canConnect(GenericFigure start, ConnectionFigure conn) {
return super.canConnect(start, conn);
}
public void addPostConn(LayerFigure layerFigure, OutputPatternListener synapse) {
OutputSwitchSynapse oss = (OutputSwitchSynapse)getOutputLayer();
oss.addOutputSynapse(synapse);
}
public void removePostConn(LayerFigure figure, OutputPatternListener conn) {
this.removePostConn(figure);
OutputSwitchSynapse oss = (OutputSwitchSynapse)getOutputLayer();
String sName = conn.getName();
oss.removeOutputSynapse(sName);
}
}
Ads help maintain this website.