mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-07 12:24:58 +10:00
Cannot type "q" letter in any of the boxes around the app
This commit is contained in:
@@ -1790,18 +1790,19 @@ public class Presenter implements IPlugInPort {
|
||||
setNewComponentTypeSlot(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// try to find a default template if none is provided
|
||||
if (componentType != null && template == null) {
|
||||
List<Template> templates = getTemplatesFor(componentType.getCategory(), componentType.getName());
|
||||
for (Template t : templates) {
|
||||
if (t.isDefaultFlag()) {
|
||||
template = t;
|
||||
break;
|
||||
if (templates != null)
|
||||
for (Template t : templates) {
|
||||
if (t.isDefaultFlag()) {
|
||||
template = t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
instantiationManager.setComponentTypeSlot(componentType, template, currentProject);
|
||||
if (componentType != null) {
|
||||
|
||||
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<property name="jar.dir" value="${build.dir}/jar" />
|
||||
<property name="report.dir" value="${build.dir}/junitreport" />
|
||||
<property name="main.class" value="org.diylc.DIYLCStarter" />
|
||||
<property name="diylc.version" value="3.34.0" />
|
||||
<property name="diylc.version" value="3.35.0" />
|
||||
|
||||
<property name="classes.dir" value="${build.dir}/temp/${ant.project.name}/classes" />
|
||||
<property name="test.classes.dir" value="${build.dir}/temp/${ant.project.name}/test.classes" />
|
||||
|
||||
Binary file not shown.
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1515,9 +1515,13 @@
|
||||
<minor>35</minor>
|
||||
<build>0</build>
|
||||
</versionNumber>
|
||||
<releaseDate>2016-12-30 20:00:00.000 CET</releaseDate>
|
||||
<releaseDate>2017-01-05 20:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Cannot type "q" letter in any of the boxes around the app</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Mirror selection horizontally and vertically</description>
|
||||
|
||||
Reference in New Issue
Block a user