projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
189b56b
)
Changed interface of GUIComponent.getPins()
author
Daniel Kirschten
<daniel.kirschten@gmx.de>
Sat, 22 Jun 2019 08:43:15 +0000
(10:43 +0200)
committer
Daniel Kirschten
<daniel.kirschten@gmx.de>
Sat, 22 Jun 2019 08:43:15 +0000
(10:43 +0200)
net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java
patch
|
blob
|
history
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java
patch
|
blob
|
history
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java
patch
|
blob
|
history
net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java
patch
|
blob
|
history
diff --git
a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java
b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java
index
29bf613
..
7858a70
100644
(file)
--- a/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java
+++ b/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java
@@
-45,7
+45,7
@@
public class LogicUIRenderer
if (DRAW_PINS)
{
gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_DARK_CYAN));
if (DRAW_PINS)
{
gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_DARK_CYAN));
- for (Pin p : component.getPins())
+ for (Pin p : component.getPins()
.values()
)
{
Point pos = p.getPos();
gc.fillOval(pos.x - 1, pos.y - 1, 2, 2);
{
Point pos = p.getPos();
gc.fillOval(pos.x - 1, pos.y - 1, 2, 2);
diff --git
a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java
b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java
index
472798f
..
a586616
100644
(file)
--- a/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java
+++ b/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java
@@
-1,7
+1,6
@@
package net.mograsim.logic.ui.model.components;
import java.util.ArrayList;
package net.mograsim.logic.ui.model.components;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@
-33,9
+32,9
@@
public abstract class GUIComponent
*/
private final Map<String, Pin> pinsByName;
/**
*/
private final Map<String, Pin> pinsByName;
/**
- * An unmodifiable view of {@link #pinsByName}
<code>.</code>{@link Map#values() values()}
.
+ * An unmodifiable view of {@link #pinsByName}.
*/
*/
- protected final
Collection<
Pin> pinsUnmodifiable;
+ protected final
Map<String,
Pin> pinsUnmodifiable;
private final List<Consumer<? super GUIComponent>> componentMovedListeners;
private final List<Consumer<? super Pin>> pinAddedListeners;
private final List<Consumer<? super GUIComponent>> componentMovedListeners;
private final List<Consumer<? super Pin>> pinAddedListeners;
@@
-53,7
+52,7
@@
public abstract class GUIComponent
this.model = model;
this.bounds = new Rectangle(0, 0, 0, 0);
this.pinsByName = new HashMap<>();
this.model = model;
this.bounds = new Rectangle(0, 0, 0, 0);
this.pinsByName = new HashMap<>();
- this.pinsUnmodifiable = Collections.unmodifiable
Collection(pinsByName.values()
);
+ this.pinsUnmodifiable = Collections.unmodifiable
Map(pinsByName
);
this.componentMovedListeners = new ArrayList<>();
this.pinAddedListeners = new ArrayList<>();
this.componentMovedListeners = new ArrayList<>();
this.pinAddedListeners = new ArrayList<>();
@@
-119,7
+118,7
@@
public abstract class GUIComponent
*
* @author Daniel Kirschten
*/
*
* @author Daniel Kirschten
*/
- public
Collection<
Pin> getPins()
+ public
Map<String,
Pin> getPins()
{
return pinsUnmodifiable;
}
{
return pinsUnmodifiable;
}
diff --git
a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java
b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java
index
8febda8
..
6aad07f
100644
(file)
--- a/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java
+++ b/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java
@@
-224,7
+224,7
@@
public abstract class SubmodelComponent extends GUIComponent
InterfacePinParams[] iPins = new InterfacePinParams[getPins().size()];
int i = 0;
InterfacePinParams[] iPins = new InterfacePinParams[getPins().size()];
int i = 0;
- for (Pin p : getPins())
+ for (Pin p : getPins()
.values()
)
{
InterfacePinParams iPinParams = new InterfacePinParams();
iPins[i] = iPinParams;
{
InterfacePinParams iPinParams = new InterfacePinParams();
iPins[i] = iPinParams;
diff --git
a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java
b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java
index
3cbc150
..
5503dc4
100644
(file)
--- a/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java
+++ b/
net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java
@@
-85,7
+85,7
@@
public class ViewLogicModelAdapter
private static Set<Pin> getAllPins(ViewModel viewModel)
{
private static Set<Pin> getAllPins(ViewModel viewModel)
{
- return viewModel.getComponents().stream().flatMap(component -> component.getPins().stream()).collect(Collectors.toSet());
+ return viewModel.getComponents().stream().flatMap(component -> component.getPins().
values().
stream()).collect(Collectors.toSet());
}
private static Map<Pin, Wire> convertWires(Set<Pin> allPins, List<GUIWire> wires, Map<Pin, Wire> externalWires,
}
private static Map<Pin, Wire> convertWires(Set<Pin> allPins, List<GUIWire> wires, Map<Pin, Wire> externalWires,