本文整理汇总了Java中com.cburch.logisim.util.LocaleManager类的典型用法代码示例。如果您正苦于以下问题:Java LocaleManager类的具体用法?Java LocaleManager怎么用?Java LocaleManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocaleManager类属于com.cburch.logisim.util包,在下文中一共展示了LocaleManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChange
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent event) {
if (AppPreferences.GATE_SHAPE.isSource(event) || AppPreferences.SHOW_TICK_RATE.isSource(event)
|| AppPreferences.ANTI_ALIASING.isSource(event)
|| AppPreferences.FILL_COMPONENT_BACKGROUND.isSource(event)) {
paintThread.requestRepaint();
} else if (AppPreferences.COMPONENT_TIPS.isSource(event)) {
boolean showTips = AppPreferences.COMPONENT_TIPS.getBoolean();
setToolTipText(showTips ? "" : null);
} else if (AppPreferences.LOOK_AND_FEEL.isSource(event)
|| AppPreferences.GRAPHICS_ACCELERATION.isSource(event)) {
int answer = JOptionPane.showConfirmDialog(null,
new LocaleManager("resources/logisim", "prefs").getter("accelRestartLabel"),
Strings.get("RestartRequired"), JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);
if (answer != 0)
// User refused to update
return;
Startup.AsktoSave(proj.getFrame());
Startup.restart();
} else if (AppPreferences.SEND_DATA.isSource(event)) {
if (AppPreferences.SEND_DATA.getBoolean())
Startup.runRemotePhpCode("http://logisim.altervista.org/LogisimData/OnlineUsers/addOnline.php");
else
Startup.runRemotePhpCode("http://logisim.altervista.org/LogisimData/OnlineUsers/removeOnline.php");
}
}
示例2: LogisimMenuBar
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public LogisimMenuBar(JFrame parent, Project proj) {
this.parent = parent;
this.listener = new MyListener();
this.proj = proj;
this.enableListeners = new ArrayList<ChangeListener>();
add(file = new MenuFile(this));
add(edit = new MenuEdit(this));
add(project = new MenuProject(this));
add(simulate = new MenuSimulate(this));
add(new WindowMenu(parent));
add(help = new MenuHelp(this));
LocaleManager.addLocaleListener(listener);
listener.localeChanged();
}
示例3: ProjectExplorer
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public ProjectExplorer(Project proj) {
super();
this.proj = proj;
setModel(new ProjectExplorerModel(proj));
setRootVisible(true);
addMouseListener(myListener);
ToolTipManager.sharedInstance().registerComponent(this);
MySelectionModel selector = new MySelectionModel();
selector.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
setSelectionModel(selector);
setCellRenderer(renderer);
addTreeSelectionListener(myListener);
InputMap imap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0),
deleteAction);
ActionMap amap = getActionMap();
amap.put(deleteAction, deleteAction);
proj.addProjectListener(myListener);
AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
LocaleManager.addLocaleListener(this);
}
示例4: setLocale
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
private static void setLocale(String lang) {
Locale[] opts = Strings.getLocaleOptions();
for (int i = 0; i < opts.length; i++) {
if (lang.equals(opts[i].toString())) {
LocaleManager.setLocale(opts[i]);
return;
}
}
logger.warn("{}", Strings.get("invalidLocaleError"));
logger.warn("{}", Strings.get("invalidLocaleOptionsHeader"));
for (int i = 0; i < opts.length; i++) {
logger.warn(" {}", opts[i].toString());
}
System.exit(-1);
}
示例5: LogisimMenuBar
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public LogisimMenuBar(JFrame parent, Project proj) {
this.parent = parent;
this.listener = new MyListener();
this.proj = proj;
this.enableListeners = new ArrayList<ChangeListener>();
add(file = new MenuFile(this));
add(edit = new MenuEdit(this));
add(project = new MenuProject(this));
add(simulate = new MenuSimulate(this));
add(fpga = new MenuFPGA(parent, this, proj));
add(new WindowMenu(parent));
add(help = new MenuHelp(this));
LocaleManager.addLocaleListener(listener);
listener.localeChanged();
}
示例6: LogisimMenuBar
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public LogisimMenuBar(JFrame parent, Project proj) {
this.parent = parent;
this.listener = new MyListener();
this.proj = proj;
this.enableListeners = new ArrayList<ChangeListener>();
add(file = new MenuFile(this));
add(edit = new MenuEdit(this));
add(project = new MenuProject(this));
add(simulate = new MenuSimulate(this));
add(new WindowMenu(parent));
add(help = new MenuHelp(this));
LocaleManager.addLocaleListener(listener);
listener.localeChanged();
}
示例7: LocalePreference
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public LocalePreference() {
super("locale", "");
String localeStr = this.get();
if (localeStr != null && !localeStr.equals("")) {
LocaleManager.setLocale(new Locale(localeStr));
}
LocaleManager.addLocaleListener(myListener);
myListener.localeChanged();
}
示例8: localeChanged
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
@Override
public void localeChanged() {
Locale loc = LocaleManager.getLocale();
String lang = loc.getLanguage();
if (LOCALE != null) {
LOCALE.set(lang);
}
}
示例9: ForkOptions
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public ForkOptions(PreferencesFrame frame) {
super(frame);
checks = new PrefBoolean[] { new PrefBoolean(AppPreferences.ANTI_ALIASING, Strings.getter("AntiAliasing")),
new PrefBoolean(AppPreferences.FILL_COMPONENT_BACKGROUND, Strings.getter("FillComponentBackground")),
new PrefBoolean(AppPreferences.SEND_DATA, Strings.getter("SendLogisimUsageData")) };
updates = new PrefOptionList(AppPreferences.AUTO_UPDATES, Strings.getter("AutoUpdates"),
new PrefOption[] { new PrefOption(AppPreferences.ALWAYS, Strings.getter("Always")),
new PrefOption(AppPreferences.ASKME, Strings.getter("AskMe")), new PrefOption(AppPreferences.NO,
new LocaleManager("resources/logisim", "data").getter("booleanFalseOption")) });
lookAndFeel = new PrefOptionList(AppPreferences.LOOK_AND_FEEL, Strings.getter("lookAndFeel"),
new PrefOption[] { new PrefOption(AppPreferences.SYSTEM, Strings.getter("systemLookAndFeel")),
new PrefOption(AppPreferences.NIMBUS, Strings.getter("nimbusLookAndFeel")),
new PrefOption(AppPreferences.METAL, Strings.getter("metalLookAndFeel")) });
setLayout(new TableLayout(1));
JPanel panel = new JPanel(new TableLayout(2));
for (int i = 0; i < checks.length; i++) {
add(checks[i]);
}
panel.add(updates.getJLabel());
panel.add(updates.getJComboBox());
panel.add(lookAndFeel.getJLabel());
panel.add(lookAndFeel.getJComboBox());
add(panel);
}
示例10: localeChanged
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
@Override
public void localeChanged() {
gateShape.localeChanged();
localeLabel.setText(Strings.get("intlLocale") + " ");
replAccents.localeChanged();
replAccents.setEnabled(LocaleManager.canReplaceAccents());
}
示例11: PreferencesFrame
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
private PreferencesFrame() {
setDefaultCloseOperation(HIDE_ON_CLOSE);
setJMenuBar(new LogisimMenuBar(this, null));
panels = new OptionsPanel[] { new TemplateOptions(this), new IntlOptions(this), new WindowOptions(this),
new LayoutOptions(this), new ExperimentalOptions(this), new ForkOptions(this), };
tabbedPane = new JTabbedPane();
int intlIndex = -1;
for (int index = 0; index < panels.length; index++) {
OptionsPanel panel = panels[index];
tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText());
if (panel instanceof IntlOptions)
intlIndex = index;
}
JPanel buttonPanel = new JPanel();
buttonPanel.add(close);
close.addActionListener(myListener);
Container contents = getContentPane();
tabbedPane.setPreferredSize(new Dimension(450, 300));
contents.add(tabbedPane, BorderLayout.CENTER);
contents.add(buttonPanel, BorderLayout.SOUTH);
if (intlIndex >= 0)
tabbedPane.setSelectedIndex(intlIndex);
LocaleManager.addLocaleListener(myListener);
myListener.localeChanged();
pack();
setLocationRelativeTo(null);
}
示例12: ProjectExplorer
import com.cburch.logisim.util.LocaleManager; //导入依赖的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);
}
示例13: Canvas
import com.cburch.logisim.util.LocaleManager; //导入依赖的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();
}
示例14: AttrTable
import com.cburch.logisim.util.LocaleManager; //导入依赖的package包/类
public AttrTable(Window parent) {
super(new BorderLayout());
this.parent = parent;
titleEnabled = true;
title = new TitleLabel();
title.setHorizontalAlignment(SwingConstants.CENTER);
title.setVerticalAlignment(SwingConstants.CENTER);
tableModel = new TableModelAdapter(parent, NULL_ATTR_MODEL);
table = new JTable(tableModel);
table.setDefaultEditor(Object.class, editor);
table.setTableHeader(null);
table.setRowHeight(20);
Font baseFont = title.getFont();
int titleSize = Math.round(baseFont.getSize() * 1.2f);
Font titleFont = baseFont.deriveFont((float) titleSize).deriveFont(Font.BOLD);
title.setFont(titleFont);
Color bgColor = new Color(240, 240, 240);
setBackground(bgColor);
table.setBackground(bgColor);
Object renderer = table.getDefaultRenderer(String.class);
if (renderer instanceof JComponent) {
((JComponent) renderer).setBackground(Color.WHITE);
}
JScrollPane tableScroll = new JScrollPane(table);
this.add(title, BorderLayout.PAGE_START);
this.add(tableScroll, BorderLayout.CENTER);
LocaleManager.addLocaleListener(this);
localeChanged();
}
示例15: LogFrame
import com.cburch.logisim.util.LocaleManager; //导入依赖的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);
}