diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/config.xml b/ diy-layout-creator --username bancika@gmail.com/DIYLC/config.xml index 6664e80a..feafa3e4 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/config.xml +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/config.xml @@ -1,4 +1,8 @@ + + autoEdit + true + default.org.diylc.components.passive.TrimmerPotentiometer:Type FLAT_LARGE diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/common/IPlugInPort.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/common/IPlugInPort.java index 2d06dc7a..13514fb1 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/common/IPlugInPort.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/common/IPlugInPort.java @@ -40,6 +40,7 @@ public interface IPlugInPort { public static final String SNAP_TO_GRID_KEY = "snapToGrid"; public static final String AUTO_PADS_KEY = "autoCreatePads"; 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 @@ -163,8 +164,9 @@ public interface IPlugInPort { * @param ctrlDown * @param shiftDown * @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. diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/core/IView.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/core/IView.java index 17322ab7..fe11e4b5 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/core/IView.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/core/IView.java @@ -1,5 +1,10 @@ package org.diylc.core; +import java.util.List; +import java.util.Set; + +import org.diylc.common.PropertyWrapper; + /** * Base interface for the main GUI component. @@ -28,4 +33,6 @@ public interface IView { void showMessage(String message, String title, int messageType); int showConfirmDialog(String message, String title, int optionType, int messageType); + + boolean editProperties(List properties, Set defaultedProperties); } diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java index b07b761f..273d188a 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/presenter/Presenter.java @@ -19,6 +19,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import javax.swing.JOptionPane; + import org.apache.log4j.Logger; import org.diylc.common.ComponentType; import org.diylc.common.DrawOption; @@ -348,120 +350,160 @@ public class Presenter implements IPlugInPort { } @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 .format("mouseClicked(%s, %s, %s, %s)", point, ctrlDown, shiftDown, altDown)); Point scaledPoint = scalePoint(point); - if (instantiationManager.getComponentTypeSlot() != null) { - // Keep the reference to component type for later. - ComponentType componentTypeSlot = instantiationManager.getComponentTypeSlot(); - Project oldProject = cloner.deepClone(currentProject); - switch (componentTypeSlot.getCreationMethod()) { - case SINGLE_CLICK: - try { - 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> newSelection = new ArrayList>(); - 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) { + if (clickCount >= 2) { + editSelection(); + } else { + if (instantiationManager.getComponentTypeSlot() != null) { + // Keep the reference to component type for later. + ComponentType componentTypeSlot = instantiationManager.getComponentTypeSlot(); + Project oldProject = cloner.deepClone(currentProject); + switch (componentTypeSlot.getCreationMethod()) { + case SINGLE_CLICK: 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> newSelection = new ArrayList>(); + newSelection.add(component); + updateSelection(newSelection); } catch (Exception e) { - view.showMessage("Could not create component. Check log for details.", - "Error", IView.ERROR_MESSAGE); - LOG.error("Could not create component", e); + LOG.error("Error instatiating component of type: " + + componentTypeSlot.getInstanceClass().getName(), e); } - messageDispatcher.dispatchMessage(EventType.SLOT_CHANGED, componentTypeSlot, - instantiationManager.getFirstControlPoint()); - messageDispatcher.dispatchMessage(EventType.REPAINT); - } 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> newSelection = new ArrayList>(); - if (!isComponentLocked(componentSlot)) { - newSelection.add(componentSlot); + + if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.AUTO_EDIT_KEY, + false)) { + editSelection(); } - updateSelection(newSelection); - messageDispatcher.dispatchMessage(EventType.REPAINT); 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> newSelection = new ArrayList>( - selectedComponents); - List> 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)); + 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 { + instantiationManager + .instatiatePointByPoint(scaledPoint, currentProject); + } catch (Exception e) { + view.showMessage("Could not create component. Check log for details.", + "Error", IView.ERROR_MESSAGE); + LOG.error("Could not create component", e); + } + messageDispatcher.dispatchMessage(EventType.SLOT_CHANGED, + componentTypeSlot, instantiationManager.getFirstControlPoint()); + messageDispatcher.dispatchMessage(EventType.REPAINT); } 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> newSelection = new ArrayList>(); + 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> newSelection = new ArrayList>( + selectedComponents); + List> 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)); } - } else { - // Otherwise just select that one component. - newSelection.clear(); - newSelection.addAll(findAllGroupedComponents(component)); + } + updateSelection(newSelection); + // messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED, + // selectedComponents); + // messageDispatcher.dispatchMessage(EventType.SELECTION_SIZE_CHANGED, + // calculateSelectionDimension()); + messageDispatcher.dispatchMessage(EventType.REPAINT); + } + } + } + + private void editSelection() { + List properties = getMutualSelectionProperties(); + if (properties != null && !properties.isEmpty()) { + Set defaultedProperties = new HashSet(); + 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)); if (instantiationManager.getComponentTypeSlot() != null) { LOG.debug("Cannot start drag because a new component is being created."); - mouseClicked(point, ctrlDown, shiftDown, altDown); + mouseClicked(point, ctrlDown, shiftDown, altDown, 1); return; } dragInProgress = true; diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/MainFrame.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/MainFrame.java index 67808c62..36b1402e 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/MainFrame.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/MainFrame.java @@ -11,7 +11,9 @@ import java.awt.event.WindowEvent; import java.util.Arrays; import java.util.EnumSet; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.Set; import javax.swing.Action; import javax.swing.BoxLayout; @@ -35,10 +37,12 @@ import org.diylc.common.EventType; import org.diylc.common.IPlugIn; import org.diylc.common.IPlugInPort; import org.diylc.common.ITask; +import org.diylc.common.PropertyWrapper; import org.diylc.core.IView; import org.diylc.images.IconLoader; import org.diylc.presenter.Presenter; import org.diylc.swing.ISwingUI; +import org.diylc.swing.gui.editor.PropertyEditorDialog; import org.diylc.swing.plugins.canvas.CanvasPlugin; import org.diylc.swing.plugins.config.ConfigPlugin; 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.toolbox.ToolBox; +import com.diyfever.gui.ButtonDialog; + public class MainFrame extends JFrame implements ISwingUI { 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); } + @Override + public boolean editProperties(List properties, Set 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) { JMenu menu; if (menuMap.containsKey(menuName)) { diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/TemplateDialog.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/TemplateDialog.java index b23ce574..385a4184 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/TemplateDialog.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/gui/TemplateDialog.java @@ -15,6 +15,7 @@ import java.io.File; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; +import java.util.Set; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -34,6 +35,7 @@ import javax.swing.event.ListSelectionListener; import org.apache.log4j.Logger; import org.diylc.common.DrawOption; import org.diylc.common.IPlugInPort; +import org.diylc.common.PropertyWrapper; import org.diylc.core.IView; import org.diylc.presenter.Presenter; @@ -77,6 +79,11 @@ public class TemplateDialog extends JDialog { public void showMessage(String message, String title, int messageType) { JOptionPane.showMessageDialog(TemplateDialog.this, message, title, messageType); } + + @Override + public boolean editProperties(List properties, Set defaultedProperties) { + return false; + } }); // this.presenter.installPlugin(new IPlugIn() { // diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/canvas/CanvasPanel.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/canvas/CanvasPanel.java index a5d210a7..29aa47b7 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/canvas/CanvasPanel.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/canvas/CanvasPanel.java @@ -25,11 +25,14 @@ import java.util.List; import javax.swing.AbstractAction; import javax.swing.JComponent; +import javax.swing.JOptionPane; import javax.swing.KeyStroke; +import org.apache.log4j.Logger; import org.diylc.common.DrawOption; import org.diylc.common.IPlugInPort; import org.diylc.common.PropertyWrapper; +import org.diylc.presenter.Presenter; import org.diylc.swing.gui.DialogFactory; import org.diylc.swing.gui.editor.PropertyEditorDialog; @@ -43,6 +46,8 @@ import com.diyfever.gui.miscutils.ConfigurationManager; */ class CanvasPanel extends JComponent implements Autoscroll { + private static final Logger LOG = Logger.getLogger(CanvasPanel.class); + private static final long serialVersionUID = 1L; private IPlugInPort plugInPort; @@ -185,53 +190,61 @@ class CanvasPanel extends JComponent implements Autoscroll { @Override public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { - if (e.getClickCount() == 2) { - List properties = plugInPort - .getMutualSelectionProperties(); - if (properties == null || properties.isEmpty()) { - // properties = plugInPort.getProjectProperties(); - // PropertyEditorDialog editor = - // DialogFactory.getInstance() - // .createPropertyEditorDialog(properties, - // "Edit Project"); - // editor.setVisible(true); - // if - // (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) - // { - // plugInPort.applyPropertiesToProject(properties); - // // Save default values. - // for (PropertyWrapper property : - // editor.getDefaultedProperties()) { - // if (property.getValue() != null) { - // plugInPort.setProjectDefaultPropertyValue(property.getName(), - // property.getValue()); - // } - // } - // } - } else { - PropertyEditorDialog editor = DialogFactory.getInstance() - .createPropertyEditorDialog(properties, "Edit Selection"); - editor.setVisible(true); - if (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) { - try { - plugInPort.applyPropertiesToSelection(properties); - } catch (Exception e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - // Save default values. - for (PropertyWrapper property : editor.getDefaultedProperties()) { - if (property.getValue() != null) { - plugInPort.setSelectionDefaultPropertyValue(property - .getName(), property.getValue()); - } - } - } - } - } else { - plugInPort.mouseClicked(e.getPoint(), e.isControlDown(), e.isShiftDown(), e - .isAltDown()); - } + // if (e.getClickCount() == 2) { + // List properties = plugInPort + // .getMutualSelectionProperties(); + // if (properties == null || properties.isEmpty()) { + // // properties = plugInPort.getProjectProperties(); + // // PropertyEditorDialog editor = + // // DialogFactory.getInstance() + // // .createPropertyEditorDialog(properties, + // // "Edit Project"); + // // editor.setVisible(true); + // // if + // // + // (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) + // // { + // // plugInPort.applyPropertiesToProject(properties); + // // // Save default values. + // // for (PropertyWrapper property : + // // editor.getDefaultedProperties()) { + // // if (property.getValue() != null) { + // // + // plugInPort.setProjectDefaultPropertyValue(property.getName(), + // // property.getValue()); + // // } + // // } + // // } + // } else { + // PropertyEditorDialog editor = DialogFactory.getInstance() + // .createPropertyEditorDialog(properties, + // "Edit Selection"); + // editor.setVisible(true); + // if + // (ButtonDialog.OK.equals(editor.getSelectedButtonCaption())) + // { + // try { + // plugInPort.applyPropertiesToSelection(properties); + // } catch (Exception e1) { + // JOptionPane.showMessageDialog(CanvasPanel.this, + // "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 : + // editor.getDefaultedProperties()) { + // if (property.getValue() != null) { + // plugInPort.setSelectionDefaultPropertyValue(property + // .getName(), property.getValue()); + // } + // } + // } + // } + // } else { + plugInPort.mouseClicked(e.getPoint(), e.isControlDown(), e.isShiftDown(), e + .isAltDown(), e.getClickCount()); + // } } } }); diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/config/ConfigPlugin.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/config/ConfigPlugin.java index 2bdad5d8..1b8828ae 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/config/ConfigPlugin.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/config/ConfigPlugin.java @@ -50,6 +50,8 @@ public class ConfigPlugin implements IPlugIn { "Snap to Grid", IPlugInPort.SNAP_TO_GRID_KEY, true), CONFIG_MENU); swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort, "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, "Continuous Creation", IPlugInPort.CONTINUOUS_CREATION_KEY, false), CONFIG_MENU); File themeDir = new File("themes"); diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/file/ProjectPreview.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/file/ProjectPreview.java index 784268a2..d5476264 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/file/ProjectPreview.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/swing/plugins/file/ProjectPreview.java @@ -10,6 +10,8 @@ import java.beans.PropertyChangeListener; import java.io.File; import java.io.FileInputStream; import java.util.EnumSet; +import java.util.List; +import java.util.Set; import javax.swing.JComponent; import javax.swing.JFileChooser; @@ -18,6 +20,7 @@ import javax.swing.JPanel; import org.diylc.common.DrawOption; import org.diylc.common.IPlugInPort; +import org.diylc.common.PropertyWrapper; import org.diylc.core.IView; import org.diylc.core.Project; import org.diylc.presenter.Presenter; @@ -58,6 +61,11 @@ public class ProjectPreview extends JPanel implements PropertyChangeListener, IF @Override public void showMessage(String message, String title, int messageType) { } + + @Override + public boolean editProperties(List properties, Set defaultedProperties) { + return false; + } }); xStream = new XStream(new DomDriver()); diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/update.xml b/ diy-layout-creator --username bancika@gmail.com/DIYLC/update.xml index f2242336..c55dafe3 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/update.xml +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/update.xml @@ -252,6 +252,10 @@ NEW_FEATURE Auto-create solder pads + + NEW_FEATURE + Auto-edit mode + NEW_FEATURE Continuous component creation