auto-edit mode

This commit is contained in:
bancika
2011-02-24 00:02:32 +00:00
parent 3856af3e18
commit 4154225e71
10 changed files with 249 additions and 145 deletions
@@ -1,4 +1,8 @@
<map> <map>
<entry>
<string>autoEdit</string>
<boolean>true</boolean>
</entry>
<entry> <entry>
<string>default.org.diylc.components.passive.TrimmerPotentiometer:Type</string> <string>default.org.diylc.components.passive.TrimmerPotentiometer:Type</string>
<org.diylc.components.passive.TrimmerPotentiometer_-TrimmerType>FLAT_LARGE</org.diylc.components.passive.TrimmerPotentiometer_-TrimmerType> <org.diylc.components.passive.TrimmerPotentiometer_-TrimmerType>FLAT_LARGE</org.diylc.components.passive.TrimmerPotentiometer_-TrimmerType>
@@ -40,6 +40,7 @@ public interface IPlugInPort {
public static final String SNAP_TO_GRID_KEY = "snapToGrid"; public static final String SNAP_TO_GRID_KEY = "snapToGrid";
public static final String AUTO_PADS_KEY = "autoCreatePads"; public static final String AUTO_PADS_KEY = "autoCreatePads";
public static final String CONTINUOUS_CREATION_KEY = "continuousCreation"; public static final String CONTINUOUS_CREATION_KEY = "continuousCreation";
public static final String AUTO_EDIT_KEY = "autoEdit";
/** /**
* Returns size of the canvas that takes project dimensions into account as * Returns size of the canvas that takes project dimensions into account as
@@ -163,8 +164,9 @@ public interface IPlugInPort {
* @param ctrlDown * @param ctrlDown
* @param shiftDown * @param shiftDown
* @param altDown * @param altDown
* @param clickCount
*/ */
void mouseClicked(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown); void mouseClicked(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown, int clickCount);
/** /**
* Notifies the presenter that mouse is moved. * Notifies the presenter that mouse is moved.
@@ -1,5 +1,10 @@
package org.diylc.core; package org.diylc.core;
import java.util.List;
import java.util.Set;
import org.diylc.common.PropertyWrapper;
/** /**
* Base interface for the main GUI component. * Base interface for the main GUI component.
@@ -28,4 +33,6 @@ public interface IView {
void showMessage(String message, String title, int messageType); void showMessage(String message, String title, int messageType);
int showConfirmDialog(String message, String title, int optionType, int messageType); int showConfirmDialog(String message, String title, int optionType, int messageType);
boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties);
} }
@@ -19,6 +19,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import javax.swing.JOptionPane;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.diylc.common.ComponentType; import org.diylc.common.ComponentType;
import org.diylc.common.DrawOption; import org.diylc.common.DrawOption;
@@ -348,120 +350,160 @@ public class Presenter implements IPlugInPort {
} }
@Override @Override
public void mouseClicked(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown) { public void mouseClicked(Point point, boolean ctrlDown, boolean shiftDown, boolean altDown,
int clickCount) {
LOG.debug(String LOG.debug(String
.format("mouseClicked(%s, %s, %s, %s)", point, ctrlDown, shiftDown, altDown)); .format("mouseClicked(%s, %s, %s, %s)", point, ctrlDown, shiftDown, altDown));
Point scaledPoint = scalePoint(point); Point scaledPoint = scalePoint(point);
if (instantiationManager.getComponentTypeSlot() != null) { if (clickCount >= 2) {
// Keep the reference to component type for later. editSelection();
ComponentType componentTypeSlot = instantiationManager.getComponentTypeSlot(); } else {
Project oldProject = cloner.deepClone(currentProject); if (instantiationManager.getComponentTypeSlot() != null) {
switch (componentTypeSlot.getCreationMethod()) { // Keep the reference to component type for later.
case SINGLE_CLICK: ComponentType componentTypeSlot = instantiationManager.getComponentTypeSlot();
try { Project oldProject = cloner.deepClone(currentProject);
if (ConfigurationManager.getInstance().readBoolean( switch (componentTypeSlot.getCreationMethod()) {
IPlugInPort.SNAP_TO_GRID_KEY, true)) { case SINGLE_CLICK:
CalcUtils.snapPointToGrid(scaledPoint, currentProject.getGridSpacing());
}
IDIYComponent<?> component = instantiationManager.instantiateComponent(
componentTypeSlot, scaledPoint, currentProject);
addComponent(component, componentTypeSlot, true);
// Select the new component
// messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED,
// selectedComponents);
// messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED,
// calculateSelectionDimension());
messageDispatcher.dispatchMessage(EventType.REPAINT);
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
newSelection.add(component);
updateSelection(newSelection);
} catch (Exception e) {
LOG.error("Error instatiating component of type: "
+ componentTypeSlot.getInstanceClass().getName(), e);
}
if (ConfigurationManager.getInstance().readBoolean(
IPlugInPort.CONTINUOUS_CREATION_KEY, false)) {
setNewComponentTypeSlot(componentTypeSlot);
} else {
setNewComponentTypeSlot(null);
}
break;
case POINT_BY_POINT:
// First click is just to set the controlPointSlot and
// componentSlot.
if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.SNAP_TO_GRID_KEY,
true)) {
CalcUtils.snapPointToGrid(scaledPoint, currentProject.getGridSpacing());
}
if (instantiationManager.getComponentSlot() == null) {
try { try {
instantiationManager.instatiatePointByPoint(scaledPoint, currentProject); if (ConfigurationManager.getInstance().readBoolean(
IPlugInPort.SNAP_TO_GRID_KEY, true)) {
CalcUtils.snapPointToGrid(scaledPoint, currentProject.getGridSpacing());
}
IDIYComponent<?> component = instantiationManager.instantiateComponent(
componentTypeSlot, scaledPoint, currentProject);
addComponent(component, componentTypeSlot, true);
// Select the new component
// messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED,
// selectedComponents);
// messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED,
// calculateSelectionDimension());
messageDispatcher.dispatchMessage(EventType.REPAINT);
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
newSelection.add(component);
updateSelection(newSelection);
} catch (Exception e) { } catch (Exception e) {
view.showMessage("Could not create component. Check log for details.", LOG.error("Error instatiating component of type: "
"Error", IView.ERROR_MESSAGE); + componentTypeSlot.getInstanceClass().getName(), e);
LOG.error("Could not create component", e);
} }
messageDispatcher.dispatchMessage(EventType.SLOT_CHANGED, componentTypeSlot,
instantiationManager.getFirstControlPoint()); if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.AUTO_EDIT_KEY,
messageDispatcher.dispatchMessage(EventType.REPAINT); false)) {
} else { editSelection();
// On the second click, add the component to the project.
IDIYComponent<?> componentSlot = instantiationManager.getComponentSlot();
componentSlot.setControlPoint(scaledPoint, 1);
addComponent(componentSlot, componentTypeSlot, true);
// Select the new component if it's not locked.
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
if (!isComponentLocked(componentSlot)) {
newSelection.add(componentSlot);
} }
updateSelection(newSelection);
messageDispatcher.dispatchMessage(EventType.REPAINT);
if (ConfigurationManager.getInstance().readBoolean( if (ConfigurationManager.getInstance().readBoolean(
IPlugInPort.CONTINUOUS_CREATION_KEY, false)) { IPlugInPort.CONTINUOUS_CREATION_KEY, false)) {
setNewComponentTypeSlot(componentTypeSlot); setNewComponentTypeSlot(componentTypeSlot);
} else { } else {
setNewComponentTypeSlot(null); setNewComponentTypeSlot(null);
} }
} break;
break; case POINT_BY_POINT:
default: // First click is just to set the controlPointSlot and
LOG.error("Unknown creation method: " + componentTypeSlot.getCreationMethod()); // componentSlot.
} if (ConfigurationManager.getInstance().readBoolean(
// Notify the listeners. IPlugInPort.SNAP_TO_GRID_KEY, true)) {
if (!oldProject.equals(currentProject)) { CalcUtils.snapPointToGrid(scaledPoint, currentProject.getGridSpacing());
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner }
.deepClone(currentProject), "Add " + componentTypeSlot.getName()); if (instantiationManager.getComponentSlot() == null) {
projectFileManager.notifyFileChange(); try {
} instantiationManager
} else { .instatiatePointByPoint(scaledPoint, currentProject);
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>( } catch (Exception e) {
selectedComponents); view.showMessage("Could not create component. Check log for details.",
List<IDIYComponent<?>> components = findComponentsAt(scaledPoint); "Error", IView.ERROR_MESSAGE);
// If there's nothing under mouse cursor deselect all. LOG.error("Could not create component", e);
if (components.isEmpty()) { }
newSelection.clear(); messageDispatcher.dispatchMessage(EventType.SLOT_CHANGED,
} else { componentTypeSlot, instantiationManager.getFirstControlPoint());
IDIYComponent<?> component = components.get(components.size() - 1); messageDispatcher.dispatchMessage(EventType.REPAINT);
// If ctrl is pressed just toggle the component under mouse
// cursor.
if (ctrlDown) {
if (newSelection.contains(component)) {
newSelection.removeAll(findAllGroupedComponents(component));
} else { } else {
// On the second click, add the component to the
// project.
IDIYComponent<?> componentSlot = instantiationManager.getComponentSlot();
componentSlot.setControlPoint(scaledPoint, 1);
addComponent(componentSlot, componentTypeSlot, true);
// Select the new component if it's not locked.
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
if (!isComponentLocked(componentSlot)) {
newSelection.add(componentSlot);
}
updateSelection(newSelection);
messageDispatcher.dispatchMessage(EventType.REPAINT);
if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.AUTO_EDIT_KEY, false)) {
editSelection();
}
if (ConfigurationManager.getInstance().readBoolean(
IPlugInPort.CONTINUOUS_CREATION_KEY, false)) {
setNewComponentTypeSlot(componentTypeSlot);
} else {
setNewComponentTypeSlot(null);
}
}
break;
default:
LOG.error("Unknown creation method: " + componentTypeSlot.getCreationMethod());
}
// Notify the listeners.
if (!oldProject.equals(currentProject)) {
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject,
cloner.deepClone(currentProject), "Add " + componentTypeSlot.getName());
projectFileManager.notifyFileChange();
}
} else {
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>(
selectedComponents);
List<IDIYComponent<?>> components = findComponentsAt(scaledPoint);
// If there's nothing under mouse cursor deselect all.
if (components.isEmpty()) {
newSelection.clear();
} else {
IDIYComponent<?> component = components.get(components.size() - 1);
// If ctrl is pressed just toggle the component under mouse
// cursor.
if (ctrlDown) {
if (newSelection.contains(component)) {
newSelection.removeAll(findAllGroupedComponents(component));
} else {
newSelection.addAll(findAllGroupedComponents(component));
}
} else {
// Otherwise just select that one component.
newSelection.clear();
newSelection.addAll(findAllGroupedComponents(component)); newSelection.addAll(findAllGroupedComponents(component));
} }
} else { }
// Otherwise just select that one component. updateSelection(newSelection);
newSelection.clear(); // messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED,
newSelection.addAll(findAllGroupedComponents(component)); // selectedComponents);
// messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED,
// calculateSelectionDimension());
messageDispatcher.dispatchMessage(EventType.REPAINT);
}
}
}
private void editSelection() {
List<PropertyWrapper> properties = getMutualSelectionProperties();
if (properties != null && !properties.isEmpty()) {
Set<PropertyWrapper> defaultedProperties = new HashSet<PropertyWrapper>();
boolean edited = view.editProperties(properties, defaultedProperties);
if (edited) {
try {
applyPropertiesToSelection(properties);
} catch (Exception e1) {
view.showMessage(
"Error occured while editing selection. Check the log for details.",
"Error", JOptionPane.ERROR_MESSAGE);
LOG.error("Error applying properties", e1);
}
// Save default values.
for (PropertyWrapper property : defaultedProperties) {
if (property.getValue() != null) {
setSelectionDefaultPropertyValue(property.getName(), property.getValue());
}
} }
} }
updateSelection(newSelection);
// messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED,
// selectedComponents);
// messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED,
// calculateSelectionDimension());
messageDispatcher.dispatchMessage(EventType.REPAINT);
} }
} }
@@ -556,7 +598,7 @@ public class Presenter implements IPlugInPort {
LOG.debug(String.format("dragStarted(%s)", point)); LOG.debug(String.format("dragStarted(%s)", point));
if (instantiationManager.getComponentTypeSlot() != null) { if (instantiationManager.getComponentTypeSlot() != null) {
LOG.debug("Cannot start drag because a new component is being created."); LOG.debug("Cannot start drag because a new component is being created.");
mouseClicked(point, ctrlDown, shiftDown, altDown); mouseClicked(point, ctrlDown, shiftDown, altDown, 1);
return; return;
} }
dragInProgress = true; dragInProgress = true;
@@ -11,7 +11,9 @@ import java.awt.event.WindowEvent;
import java.util.Arrays; import java.util.Arrays;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
@@ -35,10 +37,12 @@ import org.diylc.common.EventType;
import org.diylc.common.IPlugIn; import org.diylc.common.IPlugIn;
import org.diylc.common.IPlugInPort; import org.diylc.common.IPlugInPort;
import org.diylc.common.ITask; import org.diylc.common.ITask;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IView; import org.diylc.core.IView;
import org.diylc.images.IconLoader; import org.diylc.images.IconLoader;
import org.diylc.presenter.Presenter; import org.diylc.presenter.Presenter;
import org.diylc.swing.ISwingUI; import org.diylc.swing.ISwingUI;
import org.diylc.swing.gui.editor.PropertyEditorDialog;
import org.diylc.swing.plugins.canvas.CanvasPlugin; import org.diylc.swing.plugins.canvas.CanvasPlugin;
import org.diylc.swing.plugins.config.ConfigPlugin; import org.diylc.swing.plugins.config.ConfigPlugin;
import org.diylc.swing.plugins.edit.EditMenuPlugin; import org.diylc.swing.plugins.edit.EditMenuPlugin;
@@ -48,6 +52,8 @@ import org.diylc.swing.plugins.layers.LayersMenuPlugin;
import org.diylc.swing.plugins.statusbar.StatusBar; import org.diylc.swing.plugins.statusbar.StatusBar;
import org.diylc.swing.plugins.toolbox.ToolBox; import org.diylc.swing.plugins.toolbox.ToolBox;
import com.diyfever.gui.ButtonDialog;
public class MainFrame extends JFrame implements ISwingUI { public class MainFrame extends JFrame implements ISwingUI {
private static final Logger LOG = Logger.getLogger(MainFrame.class); private static final Logger LOG = Logger.getLogger(MainFrame.class);
@@ -196,6 +202,15 @@ public class MainFrame extends JFrame implements ISwingUI {
return JOptionPane.showConfirmDialog(this, message, title, optionType, messageType); return JOptionPane.showConfirmDialog(this, message, title, optionType, messageType);
} }
@Override
public boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties) {
PropertyEditorDialog editor = DialogFactory.getInstance().createPropertyEditorDialog(
properties, "Edit Selection");
editor.setVisible(true);
defaultedProperties.addAll(editor.getDefaultedProperties());
return ButtonDialog.OK.equals(editor.getSelectedButtonCaption());
}
private JMenu findOrCreateMenu(String menuName) { private JMenu findOrCreateMenu(String menuName) {
JMenu menu; JMenu menu;
if (menuMap.containsKey(menuName)) { if (menuMap.containsKey(menuName)) {
@@ -15,6 +15,7 @@ import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Set;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
@@ -34,6 +35,7 @@ import javax.swing.event.ListSelectionListener;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.diylc.common.DrawOption; import org.diylc.common.DrawOption;
import org.diylc.common.IPlugInPort; import org.diylc.common.IPlugInPort;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IView; import org.diylc.core.IView;
import org.diylc.presenter.Presenter; import org.diylc.presenter.Presenter;
@@ -77,6 +79,11 @@ public class TemplateDialog extends JDialog {
public void showMessage(String message, String title, int messageType) { public void showMessage(String message, String title, int messageType) {
JOptionPane.showMessageDialog(TemplateDialog.this, message, title, messageType); JOptionPane.showMessageDialog(TemplateDialog.this, message, title, messageType);
} }
@Override
public boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties) {
return false;
}
}); });
// this.presenter.installPlugin(new IPlugIn() { // this.presenter.installPlugin(new IPlugIn() {
// //
@@ -25,11 +25,14 @@ import java.util.List;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import org.apache.log4j.Logger;
import org.diylc.common.DrawOption; import org.diylc.common.DrawOption;
import org.diylc.common.IPlugInPort; import org.diylc.common.IPlugInPort;
import org.diylc.common.PropertyWrapper; import org.diylc.common.PropertyWrapper;
import org.diylc.presenter.Presenter;
import org.diylc.swing.gui.DialogFactory; import org.diylc.swing.gui.DialogFactory;
import org.diylc.swing.gui.editor.PropertyEditorDialog; import org.diylc.swing.gui.editor.PropertyEditorDialog;
@@ -43,6 +46,8 @@ import com.diyfever.gui.miscutils.ConfigurationManager;
*/ */
class CanvasPanel extends JComponent implements Autoscroll { class CanvasPanel extends JComponent implements Autoscroll {
private static final Logger LOG = Logger.getLogger(CanvasPanel.class);
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort; private IPlugInPort plugInPort;
@@ -185,53 +190,61 @@ class CanvasPanel extends JComponent implements Autoscroll {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) { if (e.getButton() == MouseEvent.BUTTON1) {
if (e.getClickCount() == 2) { // if (e.getClickCount() == 2) {
List<PropertyWrapper> properties = plugInPort // List<PropertyWrapper> properties = plugInPort
.getMutualSelectionProperties(); // .getMutualSelectionProperties();
if (properties == null || properties.isEmpty()) { // if (properties == null || properties.isEmpty()) {
// properties = plugInPort.getProjectProperties(); // // properties = plugInPort.getProjectProperties();
// PropertyEditorDialog editor = // // PropertyEditorDialog editor =
// DialogFactory.getInstance() // // DialogFactory.getInstance()
// .createPropertyEditorDialog(properties, // // .createPropertyEditorDialog(properties,
// "Edit Project"); // // "Edit Project");
// editor.setVisible(true); // // editor.setVisible(true);
// if // // if
// (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) // //
// { // (ButtonDialog.OK.equals(editor.getSelectedButtonCaption()))
// plugInPort.applyPropertiesToProject(properties); // // {
// // Save default values. // // plugInPort.applyPropertiesToProject(properties);
// for (PropertyWrapper property : // // // Save default values.
// editor.getDefaultedProperties()) { // // for (PropertyWrapper property :
// if (property.getValue() != null) { // // editor.getDefaultedProperties()) {
// plugInPort.setProjectDefaultPropertyValue(property.getName(), // // if (property.getValue() != null) {
// property.getValue()); // //
// } // plugInPort.setProjectDefaultPropertyValue(property.getName(),
// } // // property.getValue());
// } // // }
} else { // // }
PropertyEditorDialog editor = DialogFactory.getInstance() // // }
.createPropertyEditorDialog(properties, "Edit Selection"); // } else {
editor.setVisible(true); // PropertyEditorDialog editor = DialogFactory.getInstance()
if (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) { // .createPropertyEditorDialog(properties,
try { // "Edit Selection");
plugInPort.applyPropertiesToSelection(properties); // editor.setVisible(true);
} catch (Exception e1) { // if
// TODO Auto-generated catch block // (ButtonDialog.OK.equals(editor.getSelectedButtonCaption()))
e1.printStackTrace(); // {
} // try {
// Save default values. // plugInPort.applyPropertiesToSelection(properties);
for (PropertyWrapper property : editor.getDefaultedProperties()) { // } catch (Exception e1) {
if (property.getValue() != null) { // JOptionPane.showMessageDialog(CanvasPanel.this,
plugInPort.setSelectionDefaultPropertyValue(property // "Error occured while editing selection. Check the log for details.",
.getName(), property.getValue()); // "Error", JOptionPane.ERROR_MESSAGE);
} // LOG.error("Error applying properties", e1);
} // }
} // // Save default values.
} // for (PropertyWrapper property :
} else { // editor.getDefaultedProperties()) {
plugInPort.mouseClicked(e.getPoint(), e.isControlDown(), e.isShiftDown(), e // if (property.getValue() != null) {
.isAltDown()); // plugInPort.setSelectionDefaultPropertyValue(property
} // .getName(), property.getValue());
// }
// }
// }
// }
// } else {
plugInPort.mouseClicked(e.getPoint(), e.isControlDown(), e.isShiftDown(), e
.isAltDown(), e.getClickCount());
// }
} }
} }
}); });
@@ -50,6 +50,8 @@ public class ConfigPlugin implements IPlugIn {
"Snap to Grid", IPlugInPort.SNAP_TO_GRID_KEY, true), CONFIG_MENU); "Snap to Grid", IPlugInPort.SNAP_TO_GRID_KEY, true), CONFIG_MENU);
swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort, swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort,
"Auto-Create Pads", IPlugInPort.AUTO_PADS_KEY, false), CONFIG_MENU); "Auto-Create Pads", IPlugInPort.AUTO_PADS_KEY, false), CONFIG_MENU);
swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort,
"Auto-Edit Mode", IPlugInPort.AUTO_EDIT_KEY, false), CONFIG_MENU);
swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort, swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort,
"Continuous Creation", IPlugInPort.CONTINUOUS_CREATION_KEY, false), CONFIG_MENU); "Continuous Creation", IPlugInPort.CONTINUOUS_CREATION_KEY, false), CONFIG_MENU);
File themeDir = new File("themes"); File themeDir = new File("themes");
@@ -10,6 +10,8 @@ import java.beans.PropertyChangeListener;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
@@ -18,6 +20,7 @@ import javax.swing.JPanel;
import org.diylc.common.DrawOption; import org.diylc.common.DrawOption;
import org.diylc.common.IPlugInPort; import org.diylc.common.IPlugInPort;
import org.diylc.common.PropertyWrapper;
import org.diylc.core.IView; import org.diylc.core.IView;
import org.diylc.core.Project; import org.diylc.core.Project;
import org.diylc.presenter.Presenter; import org.diylc.presenter.Presenter;
@@ -58,6 +61,11 @@ public class ProjectPreview extends JPanel implements PropertyChangeListener, IF
@Override @Override
public void showMessage(String message, String title, int messageType) { public void showMessage(String message, String title, int messageType) {
} }
@Override
public boolean editProperties(List<PropertyWrapper> properties, Set<PropertyWrapper> defaultedProperties) {
return false;
}
}); });
xStream = new XStream(new DomDriver()); xStream = new XStream(new DomDriver());
@@ -252,6 +252,10 @@
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Auto-create solder pads</description> <description>Auto-create solder pads</description>
</com.diyfever.gui.update.Change> </com.diyfever.gui.update.Change>
<com.diyfever.gui.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Auto-edit mode</description>
</com.diyfever.gui.update.Change>
<com.diyfever.gui.update.Change> <com.diyfever.gui.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Continuous component creation</description> <description>Continuous component creation</description>