mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Cannot type "q" letter in any of the boxes around the app
This commit is contained in:
@@ -94,9 +94,10 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
DialogFactory.getInstance().initialize(this);
|
||||
|
||||
this.presenter = new Presenter(this);
|
||||
|
||||
canvasPlugin = new CanvasPlugin(this);
|
||||
|
||||
presenter.installPlugin(new ToolBox(this));
|
||||
presenter.installPlugin(new ComponentTree(this));
|
||||
presenter.installPlugin(new ToolBox(this));
|
||||
presenter.installPlugin(new FileMenuPlugin(this));
|
||||
presenter.installPlugin(new EditMenuPlugin(this));
|
||||
presenter.installPlugin(new ConfigPlugin(this));
|
||||
@@ -105,8 +106,10 @@ public class MainFrame extends JFrame implements ISwingUI {
|
||||
presenter.installPlugin(new HelpMenuPlugin(this));
|
||||
|
||||
presenter.installPlugin(new StatusBar(this));
|
||||
canvasPlugin = new CanvasPlugin(this);
|
||||
|
||||
presenter.installPlugin(canvasPlugin);
|
||||
|
||||
presenter.installPlugin(new ComponentTree(this, canvasPlugin.getCanvasPanel()));
|
||||
presenter.installPlugin(new FramePlugin());
|
||||
|
||||
try {
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.diylc.common.IPlugInPort;
|
||||
*
|
||||
* @author Branislav Stojkovic
|
||||
*/
|
||||
class CanvasPanel extends JComponent implements Autoscroll {
|
||||
public class CanvasPanel extends JComponent implements Autoscroll {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.awt.KeyboardFocusManager;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
@@ -27,9 +28,11 @@ public class ComponentTree implements IPlugIn {
|
||||
private IPlugInPort plugInPort;
|
||||
|
||||
private TreePanel treePanel;
|
||||
private JComponent canvasPanel;
|
||||
|
||||
public ComponentTree(ISwingUI swingUI) {
|
||||
public ComponentTree(ISwingUI swingUI, JComponent canvasPanel) {
|
||||
this.swingUI = swingUI;
|
||||
this.canvasPanel = canvasPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +60,11 @@ public class ComponentTree implements IPlugIn {
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent e) {
|
||||
if (e.getKeyChar() == 'q') {
|
||||
if ((canvasPanel.hasFocus() || treePanel.hasFocus())
|
||||
&& e.getKeyChar() == 'q'
|
||||
&& ConfigurationManager.getInstance()
|
||||
.readString(ConfigPlugin.COMPONENT_BROWSER, ConfigPlugin.SEARCHABLE_TREE)
|
||||
.equals(ConfigPlugin.SEARCHABLE_TREE)) {
|
||||
getTreePanel().getSearchField().requestFocusInWindow();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user