View API

API Reference
...     View API

Constructors

public MyPluginView(DLPlugIn plugin)
Calls super(plugin);

public MyPluginView()
Calls super()

Initialization

public void setup()
This method must be implemented. This method is used to initialize properties such as width and height using setWD and setHT.

public void panelSetup()
Override this method if you use any Swing controls, in order to initialize them and add them to the view. The default method does LED setup, and so any override that uses LEDs may call super.panelSetup() first to create the default LED panel, or may do its own LED setup.

Getters/Setters

public DLPlugIn getDoc()
Returns document object.

public int getMARGIN()
public void setMARGIN(int margin)
Get (set) left-right margins.

public boolean isNoName()
public void setNoName(boolean noName)
Get (set) whether or not name is printed.

public Color getBGCOL()
public void setBGCOL(Color bgcol)
Get (set) background color.

public String getPrintName()
public void setPrintName(String printName)
Get (set) plugin name (default: plugin classname).

public int getLedSize()
public void setLedSize(int ledSize)
Get (set) led size.

public void setLedPanel(JPanel ledPanel)
public JPanel getLedPanel() return ledPanel;
Get (set) led panel.

public void setLeds(JTextField[] leds)
public JTextField[] getLeds() return leds;
Get (set) led array.

public int getWD()
public void setWD(int wd)
Get (set) width.

public int getHT()
public void setHT(int ht)
Get (set) height.

public int getNameX()
public void setNameX(int nameX)
Get (set) x-coordinate of name.

public int getNameY()
public void setNameY(int nameY)
Get (set) y-coordinate of name.

public int getPolySize()
public void setPolySize(int polySize)
Get (set) polygon size.

public int[][] getPolygon()
public void setPolygon(int[][] polygon)
Get (set) polygon.

public PinDesc[] getTopPins()
public void setTopPins(PinDesc[] topPins)
Get (set) top pins.

public PinDesc[] getBotPins()
public void setBotPins(PinDesc[] botPins)
Get (set) bottom pins.

public PinDesc[] getLeftPins()
public void setLeftPins(PinDesc[] leftPins)
Get (set) left pins.

public PinDesc[] getRightPins()
public void setRightPins(PinDesc[] rightPins)
Get (set) right pins.

Applet support

protected InputStream getInputStream(String filename)
throws MalformedURLException, FileNotFoundException, IOException
Returns an input stream associated with the resource referenced by filename. If DLSim is being executed as an applet, the resource directory is the URL whose path is the same as the circuit containing the plugin. If DLSim is being executed as an application, the resource directory is the current value of the system property "user.dir".

In order to be able to execute circuits in either application or applet mode, plugin authors are advised to use getInputStream to retrieve file data used in their circuits.