Search in sources :

Example 1 with MissingShape

use of de.neemann.digital.draw.shapes.MissingShape in project Digital by hneemann.

the class InsertAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    if (node.isUnique()) {
        VisualElement visualElement = new VisualElement(node.getName()).setPos(new Vector(10, 10)).setShapeFactory(shapeFactory);
        if (getIcon() == null) {
            try {
                node.getDescription();
                setIcon(node.getIcon(shapeFactory));
            } catch (IOException ex) {
                SwingUtilities.invokeLater(new ErrorMessage(Lang.get("msg_errorImportingModel_N0", node.getName())).addCause(ex));
            }
        }
        if (visualElement.getShape() instanceof MissingShape)
            return;
        circuitComponent.setPartToInsert(visualElement);
        insertHistory.add(this);
    }
}
Also used : VisualElement(de.neemann.digital.draw.elements.VisualElement) IOException(java.io.IOException) ErrorMessage(de.neemann.gui.ErrorMessage) Vector(de.neemann.digital.draw.graphics.Vector) MissingShape(de.neemann.digital.draw.shapes.MissingShape)

Aggregations

VisualElement (de.neemann.digital.draw.elements.VisualElement)1 Vector (de.neemann.digital.draw.graphics.Vector)1 MissingShape (de.neemann.digital.draw.shapes.MissingShape)1 ErrorMessage (de.neemann.gui.ErrorMessage)1 IOException (java.io.IOException)1