mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-18 01:14:42 -04:00
Added a setting to select the wide shapes by default.
This commit is contained in:
parent
e7c00fd465
commit
b7a1dccc3d
@ -682,4 +682,11 @@ public final class Keys {
|
|||||||
public static final Key<Boolean> WIDE_SHAPE
|
public static final Key<Boolean> WIDE_SHAPE
|
||||||
= new Key<>("wideShape", false).setSecondary().allowGroupEdit();
|
= new Key<>("wideShape", false).setSecondary().allowGroupEdit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Selects the wide shapes as the default
|
||||||
|
*/
|
||||||
|
public static final Key<Boolean> SETTINGS_USE_WIDE_SHAPES
|
||||||
|
= new Key<>("wideShapeAsDefault", false).setSecondary();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
package de.neemann.digital.gui;
|
package de.neemann.digital.gui;
|
||||||
|
|
||||||
|
import de.neemann.digital.core.element.Keys;
|
||||||
import de.neemann.digital.draw.elements.VisualElement;
|
import de.neemann.digital.draw.elements.VisualElement;
|
||||||
import de.neemann.digital.draw.graphics.Vector;
|
import de.neemann.digital.draw.graphics.Vector;
|
||||||
import de.neemann.digital.draw.library.LibraryNode;
|
import de.neemann.digital.draw.library.LibraryNode;
|
||||||
@ -57,8 +58,19 @@ public final class InsertAction extends ToolTipAction {
|
|||||||
SwingUtilities.invokeLater(new ErrorMessage(Lang.get("msg_errorImportingModel_N0", node.getName())).addCause(ex));
|
SwingUtilities.invokeLater(new ErrorMessage(Lang.get("msg_errorImportingModel_N0", node.getName())).addCause(ex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the wide shape option to the new element
|
||||||
|
try {
|
||||||
|
if (Settings.getInstance().get(Keys.SETTINGS_USE_WIDE_SHAPES)
|
||||||
|
&& node.getDescription().hasAttribute(Keys.WIDE_SHAPE))
|
||||||
|
visualElement.setAttribute(Keys.WIDE_SHAPE, true);
|
||||||
|
} catch (IOException e1) {
|
||||||
|
// do nothing on error
|
||||||
|
}
|
||||||
|
|
||||||
if (visualElement.getShape() instanceof MissingShape)
|
if (visualElement.getShape() instanceof MissingShape)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
circuitComponent.setPartToInsert(visualElement);
|
circuitComponent.setPartToInsert(visualElement);
|
||||||
insertHistory.add(this);
|
insertHistory.add(this);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ public final class Settings implements AttributeListener {
|
|||||||
private Settings() {
|
private Settings() {
|
||||||
List<Key> intList = new ArrayList<>();
|
List<Key> intList = new ArrayList<>();
|
||||||
intList.add(Keys.SETTINGS_IEEE_SHAPES);
|
intList.add(Keys.SETTINGS_IEEE_SHAPES);
|
||||||
|
intList.add(Keys.SETTINGS_USE_WIDE_SHAPES);
|
||||||
intList.add(Keys.SETTINGS_LANGUAGE);
|
intList.add(Keys.SETTINGS_LANGUAGE);
|
||||||
intList.add(Keys.SETTINGS_EXPRESSION_FORMAT);
|
intList.add(Keys.SETTINGS_EXPRESSION_FORMAT);
|
||||||
intList.add(Keys.SETTINGS_DEFAULT_TREESELECT);
|
intList.add(Keys.SETTINGS_DEFAULT_TREESELECT);
|
||||||
|
@ -1196,7 +1196,8 @@ Sind evtl. die Namen der Variablen nicht eindeutig?</string>
|
|||||||
</string>
|
</string>
|
||||||
<string name="key_wideShape">Breites Symbol</string>
|
<string name="key_wideShape">Breites Symbol</string>
|
||||||
<string name="key_wideShape_tt">Verwendet ein breiteres Symbol zur Darstellung des Gatters.</string>
|
<string name="key_wideShape_tt">Verwendet ein breiteres Symbol zur Darstellung des Gatters.</string>
|
||||||
|
<string name="key_wideShapeAsDefault">Standardmäßig breites Symbol verwenden.</string>
|
||||||
|
<string name="key_wideShapeAsDefault_tt">Werden neue Gatter eingefügt, wird standardmäßig die breite Variante gewählt.</string>
|
||||||
|
|
||||||
<string name="key_shapeType">Form</string>
|
<string name="key_shapeType">Form</string>
|
||||||
<string name="key_shapeType_tt">Die Form, welche für die Repräsentation der Schaltung in einer einbettenden
|
<string name="key_shapeType_tt">Die Form, welche für die Repräsentation der Schaltung in einer einbettenden
|
||||||
|
@ -1188,6 +1188,8 @@
|
|||||||
</string>
|
</string>
|
||||||
<string name="key_wideShape">Wide Shape</string>
|
<string name="key_wideShape">Wide Shape</string>
|
||||||
<string name="key_wideShape_tt">Uses a wider shape to visualize the gate.</string>
|
<string name="key_wideShape_tt">Uses a wider shape to visualize the gate.</string>
|
||||||
|
<string name="key_wideShapeAsDefault">Use wider shapes by default.</string>
|
||||||
|
<string name="key_wideShapeAsDefault_tt">If new gates are inserted, the wide variant is selected by default.</string>
|
||||||
|
|
||||||
<string name="key_shapeType">Shape</string>
|
<string name="key_shapeType">Shape</string>
|
||||||
<string name="key_shapeType_tt">The shape to be used for the representation of the circuit in an embedding circuit.
|
<string name="key_shapeType_tt">The shape to be used for the representation of the circuit in an embedding circuit.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user