当前位置: 首页>>代码示例>>Java>>正文


Java LocaleManager.addLocaleListener方法代码示例

本文整理汇总了Java中com.cburch.logisim.util.LocaleManager.addLocaleListener方法的典型用法代码示例。如果您正苦于以下问题:Java LocaleManager.addLocaleListener方法的具体用法?Java LocaleManager.addLocaleListener怎么用?Java LocaleManager.addLocaleListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.cburch.logisim.util.LocaleManager的用法示例。


在下文中一共展示了LocaleManager.addLocaleListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:17,代码来源:LogisimMenuBar.java

示例2: 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);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:26,代码来源:ProjectExplorer.java

示例3: 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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:11,代码来源:AppPreferences.java

示例4: 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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:33,代码来源:PreferencesFrame.java

示例5: 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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:28,代码来源:ProjectExplorer.java

示例6: 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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:38,代码来源:Canvas.java

示例7: 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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:34,代码来源:AttrTable.java

示例8: 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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:31,代码来源:LogFrame.java

示例9: OptionsFrame

import com.cburch.logisim.util.LocaleManager; //导入方法依赖的package包/类
public OptionsFrame(Project project) {
	this.project = project;
	this.file = project.getLogisimFile();
	file.addLibraryListener(myListener);
	setDefaultCloseOperation(HIDE_ON_CLOSE);
	setJMenuBar(new LogisimMenuBar(this, project));

	panels = new OptionsPanel[] { new SimulateOptions(this), new ToolbarOptions(this), new MouseOptions(this), };
	tabbedPane = new JTabbedPane();
	for (int index = 0; index < panels.length; index++) {
		OptionsPanel panel = panels[index];
		tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText());
	}

	JPanel buttonPanel = new JPanel();
	buttonPanel.add(revert);
	buttonPanel.add(close);
	revert.addActionListener(myListener);
	close.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);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:31,代码来源:OptionsFrame.java

示例10: 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),
			new InputPanel(this) //Input de texto usuario, @José Garrido
	};
	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(close);
	close.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();
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:35,代码来源:LogFrame.java

示例11: PreferencesFrame

import com.cburch.logisim.util.LocaleManager; //导入方法依赖的package包/类
private PreferencesFrame() {
	setDefaultCloseOperation(HIDE_ON_CLOSE);
	setJMenuBar(null);

	panels = new OptionsPanel[] { new TemplateOptions(this),
			new IntlOptions(this), new WindowOptions(this),
			new LayoutOptions(this), new ExperimentalOptions(this),
			new SoftwaresOptions(this), new FPGAOptions(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(Toolkit.getDefaultToolkit().getScreenSize().width/2, 
			Toolkit.getDefaultToolkit().getScreenSize().height/2));
	contents.add(tabbedPane, BorderLayout.CENTER);
	contents.add(buttonPanel, BorderLayout.SOUTH);

	if (intlIndex >= 0)
		tabbedPane.setSelectedIndex(intlIndex);

	LocaleManager.addLocaleListener(myListener);
	myListener.localeChanged();
	pack();
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:36,代码来源:PreferencesFrame.java

示例12: 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);
	addMouseListener(myListener);
	addMouseMotionListener(myListener);
	addKeyListener(myListener);
	addMouseWheelListener(myListener);

	// YSY
	// try {
	// URL url =
	// Canvas.class.getClassLoader().getResource("resources/logisim/img/HESSO.png");
	// image = ImageIO.read(url);
	// } catch (IOException e) {
	// e.printStackTrace();
	// }

	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.SHOW_TICK_RATE.addPropertyChangeListener(myListener);
	loadOptions(options);
	paintThread.start();
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:41,代码来源:Canvas.java

示例13: 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(AppPreferences.getScaled(AppPreferences.BoxSize));


	Font baseFont = title.getFont();
	int titleSize = Math.round(baseFont.getSize() * 1.2f);
	Font titleFont = baseFont.deriveFont(AppPreferences.getScaled((float)titleSize)).deriveFont(
			Font.BOLD);
	title.setFont(titleFont);
	Color bgColor = new Color(240, 240, 240);
	setBackground(bgColor);
	table.setBackground(bgColor);
	table.setDefaultRenderer(String.class, new HDLColorRenderer());

	tabPane = new JTabbedPane();
	JPanel propPanel = new JPanel(new BorderLayout(0, 0));
	JScrollPane tableScroll = new JScrollPane(table);

	propPanel.add(title, BorderLayout.PAGE_START);
	propPanel.add(tableScroll, BorderLayout.CENTER);
	tabPane.addTab("Properties", propPanel);

	this.add(tabPane, BorderLayout.CENTER);

	LocaleManager.addLocaleListener(this);
	localeChanged();
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:39,代码来源:AttrTable.java

示例14: 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_BACK_SPACE, 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);
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:28,代码来源:ProjectExplorer.java

示例15: 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 );
	addMouseListener( myListener );
	addMouseMotionListener( 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.SHOW_TICK_RATE.addPropertyChangeListener( myListener );
	loadOptions( options );
	paintThread.start();
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:31,代码来源:Canvas.java


注:本文中的com.cburch.logisim.util.LocaleManager.addLocaleListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。