Skip to main content
summaryrefslogtreecommitdiffstats
blob: f1e732c8e9c87791b1194422267674a669b3b62a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.gef.examples.logicdesigner.model;

import org.eclipse.gef.examples.logicdesigner.LogicMessages;

public class Circuit
	extends LogicDiagram
{

static final long serialVersionUID = 1;

private static int count;

private static String name = "NoName";

public static String TERMINALS_OUT [] = 
	new String [] {	"1","2","3","4", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
				"5","6","7","8"};//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$

public static String TERMINALS_IN [] = 
	new String [] {	"A","B","C","D", //$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$
				"E","F","G","H"};//$NON-NLS-4$//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$

public String getNewID() {
	return Integer.toString(count++);
}

public String toString() {
	return LogicMessages.Circuit_LabelText + " #" + getID();  //$NON-NLS-1$
}

public void update() {
	for (int i=0; i<8;i++)
		setOutput(TERMINALS_OUT[i],getInput(TERMINALS_IN[i]));
}

public void setName(String name) {
		this.name = name;
}

public String getName() {
		return this.name;
}

}

Back to the top