本文整理汇总了Java中com.cburch.logisim.proj.Project.getFrame方法的典型用法代码示例。如果您正苦于以下问题:Java Project.getFrame方法的具体用法?Java Project.getFrame怎么用?Java Project.getFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cburch.logisim.proj.Project
的用法示例。
在下文中一共展示了Project.getFrame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureMenu
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
@Override
public void configureMenu(JPopupMenu menu, Project proj) {
this.proj = proj;
this.frame = proj.getFrame();
this.circState = proj.getCircuitState();
Object attrs = instance.getAttributeSet();
if (attrs instanceof RomAttributes) {
((RomAttributes) attrs).setProject(proj);
}
boolean enabled = circState != null;
edit = createItem(enabled, Strings.get("ramEditMenuItem"));
clear = createItem(enabled, Strings.get("ramClearMenuItem"));
load = createItem(enabled, Strings.get("ramLoadMenuItem"));
save = createItem(enabled, Strings.get("ramSaveMenuItem"));
menu.addSeparator();
menu.add(edit);
menu.add(clear);
menu.add(load);
menu.add(save);
}
示例2: isProjectFrameAt
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
private static boolean isProjectFrameAt(int x, int y) {
for (Project current : Projects.getOpenProjects()) {
Frame frame = current.getFrame();
if (frame != null) {
Point loc = frame.getLocationOnScreen();
int d = Math.abs(loc.x - x) + Math.abs(loc.y - y);
if (d <= 3)
return true;
}
}
return false;
}
示例3: doPrint
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public static void doPrint(Project proj) {
CircuitJList list = new CircuitJList(proj, true);
Frame frame = proj.getFrame();
if (list.getModel().getSize() == 0) {
JOptionPane.showMessageDialog(proj.getFrame(), Strings.get("printEmptyCircuitsMessage"),
Strings.get("printEmptyCircuitsTitle"), JOptionPane.YES_NO_OPTION);
return;
}
ParmsPanel parmsPanel = new ParmsPanel(list);
int action = JOptionPane.showConfirmDialog(frame, parmsPanel, Strings.get("printParmsTitle"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (action != JOptionPane.OK_OPTION)
return;
List<Circuit> circuits = list.getSelectedCircuits();
if (circuits.isEmpty())
return;
PageFormat format = new PageFormat();
Printable print = new MyPrintable(proj, circuits, parmsPanel.getHeader(), parmsPanel.getRotateToFit(),
parmsPanel.getPrinterView());
PrinterJob job = PrinterJob.getPrinterJob();
job.setPrintable(print, format);
if (job.printDialog() == false)
return;
try {
job.print();
} catch (PrinterException e) {
JOptionPane.showMessageDialog(proj.getFrame(), StringUtil.format(Strings.get("printError"), e.toString()),
Strings.get("printErrorTitle"), JOptionPane.ERROR_MESSAGE);
}
}
示例4: actionPerformed
import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
Project proj = menubar.getProject();
if (src == newi) {
ProjectActions.doNew(proj);
} else if (src == open) {
ProjectActions.doOpen(proj == null ? null : proj.getFrame().getCanvas(), proj);
} else if (src == close) {
Frame frame = proj.getFrame();
if (frame.confirmClose()) {
frame.dispose();
OptionsFrame f = proj.getOptionsFrame(false);
if (f != null)
f.dispose();
}
} else if (src == save) {
ProjectActions.doSave(proj);
} else if (src == saveAs) {
ProjectActions.doSaveAs(proj, true);
} else if (src == exportllo) {
ProjectActions.doSaveAs(proj, false);
} else if (src == prefs) {
PreferencesFrame.showPreferences();
} else if (src == quit) {
ProjectActions.doQuit();
}
}