本文整理汇总了Java中com.cburch.logisim.proj.Project.addProjectListener方法的典型用法代码示例。如果您正苦于以下问题:Java Project.addProjectListener方法的具体用法?Java Project.addProjectListener怎么用?Java Project.addProjectListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cburch.logisim.proj.Project
的用法示例。
在下文中一共展示了Project.addProjectListener方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimulationExplorer
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
SimulationExplorer(Project proj, MenuListener menu) {
super(new BorderLayout());
this.project = proj;
SimulationToolbarModel toolbarModel = new SimulationToolbarModel(proj, menu);
Toolbar toolbar = new Toolbar(toolbarModel);
add(toolbar, BorderLayout.NORTH);
model = new SimulationTreeModel(proj.getSimulator().getCircuitState());
model.setCurrentView(project.getCircuitState());
tree = new JTree(model);
tree.setCellRenderer(new SimulationTreeRenderer());
tree.addMouseListener(this);
tree.setToggleClickCount(3);
add(new JScrollPane(tree), BorderLayout.CENTER);
proj.addProjectListener(this);
}
示例2: LayoutEditHandler
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
LayoutEditHandler(Frame frame) {
this.frame = frame;
Project proj = frame.getProject();
Clipboard.addPropertyChangeListener(Clipboard.contentsProperty, this);
proj.addProjectListener(this);
proj.addLibraryListener(this);
}
示例3: ProjectExplorer
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public ProjectExplorer(Project proj) {
super();
this.proj = proj;
setModel(model);
setRootVisible(true);
addMouseListener(myListener);
ToolTipManager.sharedInstance().registerComponent(this);
MySelectionModel selector = new MySelectionModel();
selector.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
setSelectionModel(selector);
setCellRenderer(renderer);
JTreeUtil.configureDragAndDrop(this, new DragController());
addTreeSelectionListener(myListener);
InputMap imap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), deleteAction);
ActionMap amap = getActionMap();
amap.put(deleteAction, deleteAction);
proj.addProjectListener(myListener);
proj.addLibraryListener(myListener);
AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
myListener.setFile(proj.getLogisimFile());
LocaleManager.addLocaleListener(this);
}
示例4: Selection
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public Selection(Project proj, Canvas canvas) {
super(proj);
myListener = new MyListener();
attrs = new SelectionAttributes(canvas, this);
proj.addProjectListener(myListener);
proj.addCircuitListener(myListener);
}
示例5: register
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
void register() {
Project proj = frame.getProject();
if (proj == null) {
return;
}
proj.addProjectListener(this);
proj.addLibraryListener(this);
frame.addPropertyChangeListener(Frame.EDITOR_VIEW, this);
frame.addPropertyChangeListener(Frame.EXPLORER_VIEW, this);
Circuit circ = proj.getCurrentCircuit();
if (circ != null) {
circ.getAppearance().addCanvasModelListener(this);
}
menubar.addActionListener(LogisimMenuBar.ADD_CIRCUIT, this);
menubar.addActionListener(LogisimMenuBar.MOVE_CIRCUIT_UP, this);
menubar.addActionListener(LogisimMenuBar.MOVE_CIRCUIT_DOWN, this);
menubar.addActionListener(LogisimMenuBar.SET_MAIN_CIRCUIT, this);
menubar.addActionListener(LogisimMenuBar.REMOVE_CIRCUIT, this);
menubar.addActionListener(LogisimMenuBar.EDIT_LAYOUT, this);
menubar.addActionListener(LogisimMenuBar.EDIT_APPEARANCE, this);
menubar.addActionListener(LogisimMenuBar.VIEW_TOOLBOX, this);
menubar.addActionListener(LogisimMenuBar.VIEW_SIMULATION, this);
menubar.addActionListener(LogisimMenuBar.REVERT_APPEARANCE, this);
menubar.addActionListener(LogisimMenuBar.ANALYZE_CIRCUIT, this);
menubar.addActionListener(LogisimMenuBar.CIRCUIT_STATS, this);
computeEnabled();
}
示例6: LayoutToolbarModel
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public LayoutToolbarModel(Frame frame, Project proj) {
// this.frame = frame;
this.proj = proj;
myListener = new MyListener();
items = Collections.emptyList();
haloedTool = null;
buildContents();
// set up listeners
ToolbarData data = proj.getOptions().getToolbarData();
data.addToolbarListener(myListener);
data.addToolAttributeListener(myListener);
AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
proj.addProjectListener(myListener);
}
示例7: Canvas
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public Canvas(Project proj) {
this.proj = proj;
this.selection = new Selection(proj, this);
this.painter = new CanvasPainter(this);
this.oldPreferredSize = null;
this.paintThread = new CanvasPaintThread(this);
this.mappings = proj.getOptions().getMouseMappings();
this.canvasPane = null;
this.tickCounter = new TickCounter();
setBackground(Color.white);
setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
addMouseListener(myListener);
addMouseMotionListener(myListener);
addMouseWheelListener(myListener);
addKeyListener(myListener);
proj.addProjectListener(myProjectListener);
proj.addLibraryListener(myProjectListener);
proj.addCircuitListener(myProjectListener);
proj.getSimulator().addSimulatorListener(tickCounter);
selection.addListener(myProjectListener);
LocaleManager.addLocaleListener(this);
AttributeSet options = proj.getOptions().getAttributeSet();
options.addAttributeListener(myProjectListener);
AppPreferences.COMPONENT_TIPS.addPropertyChangeListener(myListener);
AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
AppPreferences.ANTI_ALIASING.addPropertyChangeListener(myListener);
AppPreferences.FILL_COMPONENT_BACKGROUND.addPropertyChangeListener(myListener);
AppPreferences.SEND_DATA.addPropertyChangeListener(myListener);
AppPreferences.SHOW_TICK_RATE.addPropertyChangeListener(myListener);
AppPreferences.LOOK_AND_FEEL.addPropertyChangeListener(myListener);
AppPreferences.GRAPHICS_ACCELERATION.addPropertyChangeListener(myListener);
loadOptions(options);
paintThread.start();
}
示例8: LogFrame
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public LogFrame(Project project) {
this.project = project;
this.windowManager = new WindowMenuManager();
project.addProjectListener(myListener);
project.addLibraryListener(myListener);
setDefaultCloseOperation(HIDE_ON_CLOSE);
setJMenuBar(new LogisimMenuBar(this, project));
setSimulator(project.getSimulator(), project.getCircuitState());
panels = new LogPanel[] { new SelectionPanel(this), new ScrollPanel(this), new FilePanel(this), };
tabbedPane = new JTabbedPane();
for (int index = 0; index < panels.length; index++) {
LogPanel panel = panels[index];
tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText());
}
JPanel buttonPanel = new JPanel();
buttonPanel.add(clearLog);
clearLog.addActionListener(myListener);
Container contents = getContentPane();
tabbedPane.setPreferredSize(new Dimension(450, 300));
contents.add(tabbedPane, BorderLayout.CENTER);
contents.add(buttonPanel, BorderLayout.SOUTH);
LocaleManager.addLocaleListener(myListener);
myListener.localeChanged();
pack();
setLocationRelativeTo(null);
}
示例9: ProjectManager
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
ProjectManager(Project proj) {
super(proj.getLogisimFile().getName(), false);
this.proj = proj;
proj.addProjectListener(this);
proj.addLibraryListener(this);
frameOpened(proj.getFrame());
}
示例10: ToolboxManip
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
ToolboxManip(Project proj, ProjectExplorer explorer) {
this.proj = proj;
this.explorer = explorer;
proj.addProjectListener(myListener);
myListener.setFile(null, proj.getLogisimFile());
}
示例11: MenuEdit
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public MenuEdit(LogisimMenuBar menubar) {
this.menubar = menubar;
int menuMask = getToolkit().getMenuShortcutKeyMask();
undo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, menuMask));
cut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, menuMask));
copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, menuMask));
paste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, menuMask));
delete.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
dup.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, menuMask));
selall.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, menuMask));
raise.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, menuMask));
lower.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, menuMask));
raiseTop.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, menuMask | InputEvent.SHIFT_DOWN_MASK));
lowerBottom.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, menuMask | InputEvent.SHIFT_DOWN_MASK));
add(undo);
addSeparator();
add(cut);
add(copy);
add(paste);
addSeparator();
add(delete);
add(dup);
add(selall);
addSeparator();
add(raise);
add(lower);
add(raiseTop);
add(lowerBottom);
addSeparator();
add(addCtrl);
add(remCtrl);
Project proj = menubar.getProject();
if (proj != null) {
proj.addProjectListener(myListener);
undo.addActionListener(myListener);
}
undo.setEnabled(false);
menubar.registerItem(LogisimMenuBar.CUT, cut);
menubar.registerItem(LogisimMenuBar.COPY, copy);
menubar.registerItem(LogisimMenuBar.PASTE, paste);
menubar.registerItem(LogisimMenuBar.DELETE, delete);
menubar.registerItem(LogisimMenuBar.DUPLICATE, dup);
menubar.registerItem(LogisimMenuBar.SELECT_ALL, selall);
menubar.registerItem(LogisimMenuBar.RAISE, raise);
menubar.registerItem(LogisimMenuBar.LOWER, lower);
menubar.registerItem(LogisimMenuBar.RAISE_TOP, raiseTop);
menubar.registerItem(LogisimMenuBar.LOWER_BOTTOM, lowerBottom);
menubar.registerItem(LogisimMenuBar.ADD_CONTROL, addCtrl);
menubar.registerItem(LogisimMenuBar.REMOVE_CONTROL, remCtrl);
computeEnabled();
}