Merge lp:~danilovesky/workcraft/trunk-menu-tools into lp:workcraft
- trunk-menu-tools
- Merge into trunk
Proposed by
Danil Sokolov
Status: | Merged |
---|---|
Merged at revision: | 620 |
Proposed branch: | lp:~danilovesky/workcraft/trunk-menu-tools |
Merge into: | lp:workcraft |
Diff against target: |
4777 lines (+998/-655) 125 files modified
CircuitPlugin/src/org/workcraft/plugins/circuit/Circuit.java (+2/-1) CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java (+7/-3) CircuitPlugin/src/org/workcraft/plugins/circuit/Contact.java (+4/-4) CircuitPlugin/src/org/workcraft/plugins/circuit/Environment.java (+4/-2) CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionContact.java (+5/-2) CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java (+11/-9) CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContact.java (+6/-4) CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContactFormulaProperties.java (+2/-2) CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java (+1/-1) CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionContact.java (+3/-2) CircuitPlugin/src/org/workcraft/plugins/circuit/references/CircuitReferenceManager.java (+6/-7) CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionDeserializer.java (+0/-10) CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionSerializer.java (+0/-5) CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/FunctionSerialiser.java (+8/-5) CircuitPlugin/src/org/workcraft/plugins/circuit/stg/CircuitStgUtils.java (+13/-9) CircuitPlugin/src/org/workcraft/plugins/circuit/tasks/CheckCircuitTask.java (+8/-7) CircuitPlugin/src/org/workcraft/plugins/circuit/tools/CheckCircuitTool.java (+1/-1) CpogsPlugin/src/org/workcraft/plugins/cpog/Arc.java (+8/-11) CpogsPlugin/src/org/workcraft/plugins/cpog/RhoClause.java (+4/-3) CpogsPlugin/src/org/workcraft/plugins/cpog/Variable.java (+4/-3) CpogsPlugin/src/org/workcraft/plugins/cpog/Vertex.java (+4/-3) CpogsPlugin/src/org/workcraft/plugins/cpog/VisualArc.java (+17/-29) CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenario.java (+7/-4) CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenarioPage.java (+4/-2) CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVariable.java (+3/-2) CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVertex.java (+2/-1) CpogsPlugin/src/org/workcraft/plugins/cpog/gui/ScencoConfigurationDialog.java (+5/-4) CpogsPlugin/src/org/workcraft/plugins/cpog/serialisation/BooleanFunctionDeserialiser.java (+2/-1) CpogsPlugin/src/org/workcraft/plugins/cpog/tasks/ScencoTask.java (+4/-5) DfsPlugin/src/org/workcraft/plugins/dfs/BinaryRegister.java (+3/-1) DfsPlugin/src/org/workcraft/plugins/dfs/ControlConnection.java (+2/-1) DfsPlugin/src/org/workcraft/plugins/dfs/ControlRegister.java (+5/-3) DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowLogic.java (+8/-4) DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowRegister.java (+4/-2) DfsPlugin/src/org/workcraft/plugins/dfs/Logic.java (+5/-2) DfsPlugin/src/org/workcraft/plugins/dfs/MathDelayNode.java (+4/-0) DfsPlugin/src/org/workcraft/plugins/dfs/Register.java (+3/-1) DfsPlugin/src/org/workcraft/plugins/dfs/VisualAbstractRegister.java (+4/-1) DfsPlugin/src/org/workcraft/plugins/dfs/VisualBinaryRegister.java (+1/-1) DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlConnection.java (+1/-1) DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlRegister.java (+2/-2) DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowLogic.java (+4/-4) DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowRegister.java (+2/-2) DfsPlugin/src/org/workcraft/plugins/dfs/VisualDelayComponent.java (+1/-1) DfsPlugin/src/org/workcraft/plugins/dfs/VisualLogic.java (+2/-2) DfsPlugin/src/org/workcraft/plugins/dfs/VisualRegister.java (+1/-1) DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowDeadlockTool.java (+1/-1) DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowHazardTool.java (+1/-1) DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowTool.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/Event.java (+2/-1) FsmPlugin/src/org/workcraft/plugins/fsm/Fsm.java (+5/-1) FsmPlugin/src/org/workcraft/plugins/fsm/InitialStateSupervisor.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/State.java (+5/-2) FsmPlugin/src/org/workcraft/plugins/fsm/SymbolConsistencySupervisor.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/VisualEvent.java (+5/-1) FsmPlugin/src/org/workcraft/plugins/fsm/VisualState.java (+2/-2) FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/EventSymbolPropertyDescriptor.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/SymbolPropertyDescriptor.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeadlockCheckerTool.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeterminismCheckerTool.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReachabilityCheckerTool.java (+1/-1) FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReversibilityCheckerTool.java (+1/-1) FstPlugin/src/org/workcraft/plugins/fst/Fst.java (+13/-8) FstPlugin/src/org/workcraft/plugins/fst/Signal.java (+3/-1) FstPlugin/src/org/workcraft/plugins/fst/SignalEvent.java (+3/-1) FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/DirectionPropertyDescriptor.java (+1/-1) FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/TypePropertyDescriptor.java (+2/-1) FstPlugin/src/org/workcraft/plugins/fst/tools/FstSimulationTool.java (+1/-1) MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/AbstractMpsatChecker.java (+1/-1) MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatConformationChecker.java (+1/-1) MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatCustomPropertyChecker.java (+1/-1) MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatSynthesis.java (+1/-1) PetriNetPlugin/src/org/workcraft/plugins/petri/Place.java (+5/-2) PetriNetPlugin/src/org/workcraft/plugins/petri/VisualPlace.java (+5/-4) PetriNetPlugin/src/org/workcraft/plugins/petri/tools/PetriNetSimulationTool.java (+14/-8) PetrifyPlugin/src/org/workcraft/plugins/petrify/tools/PetrifySynthesis.java (+2/-2) PolicyNetPlugin/src/org/workcraft/plugins/policy/Bundle.java (+9/-4) PolicyNetPlugin/src/org/workcraft/plugins/policy/VisualBundle.java (+3/-1) PolicyNetPlugin/src/org/workcraft/plugins/policy/tools/CheckDeadlockTool.java (+1/-1) SONPlugin/src/org/workcraft/plugins/son/gui/OutputArea.java (+1/-1) STGPlugin/src/org/workcraft/plugins/stg/DummyTransition.java (+2/-1) STGPlugin/src/org/workcraft/plugins/stg/SignalTransition.java (+7/-3) STGPlugin/src/org/workcraft/plugins/stg/SignalTypeConsistencySupervisor.java (+4/-3) STGPlugin/src/org/workcraft/plugins/stg/VisualImplicitPlaceArc.java (+4/-4) STGPlugin/src/org/workcraft/plugins/stg/VisualSTG.java (+5/-2) STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/DirectionPropertyDescriptor.java (+2/-1) STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/TypePropertyDescriptor.java (+3/-1) STGPlugin/src/org/workcraft/plugins/stg/tools/StgSimulationTool.java (+18/-12) WorkcraftCore/src/org/workcraft/dom/hierarchy/NamespaceHelper.java (+3/-3) WorkcraftCore/src/org/workcraft/dom/references/HierarchicalUniqueNameReferenceManager.java (+2/-2) WorkcraftCore/src/org/workcraft/dom/visual/FontHelper.java (+13/-0) WorkcraftCore/src/org/workcraft/dom/visual/VisualComponent.java (+22/-14) WorkcraftCore/src/org/workcraft/dom/visual/VisualGroup.java (+2/-4) WorkcraftCore/src/org/workcraft/dom/visual/VisualPage.java (+5/-2) WorkcraftCore/src/org/workcraft/dom/visual/connections/VisualConnection.java (+20/-13) WorkcraftCore/src/org/workcraft/gui/DockableWindow.java (+12/-4) WorkcraftCore/src/org/workcraft/gui/DockableWindowContentPanel.java (+5/-1) WorkcraftCore/src/org/workcraft/gui/LookAndFeelHelper.java (+38/-27) WorkcraftCore/src/org/workcraft/gui/MainMenu.java (+117/-115) WorkcraftCore/src/org/workcraft/gui/MainWindow.java (+60/-46) WorkcraftCore/src/org/workcraft/gui/MainWindowActions.java (+16/-4) WorkcraftCore/src/org/workcraft/gui/PropertyEditorWindow.java (+5/-5) WorkcraftCore/src/org/workcraft/gui/SilverOceanTheme.java (+132/-0) WorkcraftCore/src/org/workcraft/gui/graph/GraphEditorPanel.java (+15/-14) WorkcraftCore/src/org/workcraft/gui/propertyeditor/BooleanCellEditor.java (+12/-11) WorkcraftCore/src/org/workcraft/gui/propertyeditor/ChoiceCellEditor.java (+4/-1) WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellEditor.java (+4/-4) WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellRenderer.java (+11/-27) WorkcraftCore/src/org/workcraft/gui/propertyeditor/DefaultCellRenderer.java (+6/-3) WorkcraftCore/src/org/workcraft/gui/propertyeditor/FileCellEditor.java (+7/-6) WorkcraftCore/src/org/workcraft/gui/propertyeditor/GenericCellEditor.java (+4/-2) WorkcraftCore/src/org/workcraft/gui/propertyeditor/ModelProperties.java (+13/-9) WorkcraftCore/src/org/workcraft/gui/propertyeditor/NamePropertyDescriptor.java (+4/-2) WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTable.java (+60/-23) WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTableModel.java (+32/-27) WorkcraftCore/src/org/workcraft/gui/propertyeditor/StringProperty.java (+1/-1) WorkcraftCore/src/org/workcraft/gui/trees/TreeWindow.java (+2/-1) WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java (+14/-17) WorkcraftCore/src/org/workcraft/serialisation/xml/XMLDeserialiserState.java (+1/-1) WorkcraftCore/src/org/workcraft/util/Tools.java (+2/-2) WorkcraftCore/src/org/workcraft/workspace/WorkspaceEntry.java (+2/-2) XmasPlugin/src/org/workcraft/plugins/xmas/components/QueueComponent.java (+3/-2) XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualQueueComponent.java (+4/-2) XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualSourceComponent.java (+3/-1) XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasContact.java (+3/-1) |
To merge this branch: | bzr merge lp:~danilovesky/workcraft/trunk-menu-tools |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Danil Sokolov | Approve | ||
Review via email: mp+263173@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Danil Sokolov (danilovesky) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/Circuit.java' | |||
2 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/Circuit.java 2015-05-27 12:14:35 +0000 | |||
3 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/Circuit.java 2015-06-26 22:23:53 +0000 | |||
4 | @@ -32,6 +32,7 @@ | |||
5 | 32 | import org.workcraft.dom.math.MathNode; | 32 | import org.workcraft.dom.math.MathNode; |
6 | 33 | import org.workcraft.exceptions.InvalidConnectionException; | 33 | import org.workcraft.exceptions.InvalidConnectionException; |
7 | 34 | import org.workcraft.gui.propertyeditor.ModelProperties; | 34 | import org.workcraft.gui.propertyeditor.ModelProperties; |
8 | 35 | import org.workcraft.gui.propertyeditor.NamePropertyDescriptor; | ||
9 | 35 | import org.workcraft.plugins.circuit.Contact.IOType; | 36 | import org.workcraft.plugins.circuit.Contact.IOType; |
10 | 36 | import org.workcraft.plugins.circuit.references.CircuitReferenceManager; | 37 | import org.workcraft.plugins.circuit.references.CircuitReferenceManager; |
11 | 37 | import org.workcraft.serialisation.References; | 38 | import org.workcraft.serialisation.References; |
12 | @@ -88,7 +89,7 @@ | |||
13 | 88 | ModelProperties properties = super.getProperties(node); | 89 | ModelProperties properties = super.getProperties(node); |
14 | 89 | if (node != null) { | 90 | if (node != null) { |
15 | 90 | if (node instanceof Joint) { | 91 | if (node instanceof Joint) { |
17 | 91 | properties.removeByName("Name"); | 92 | properties.removeByName(NamePropertyDescriptor.PROPERTY_NAME); |
18 | 92 | } | 93 | } |
19 | 93 | } | 94 | } |
20 | 94 | return properties; | 95 | return properties; |
21 | 95 | 96 | ||
22 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java' | |||
23 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java 2015-05-20 16:27:35 +0000 | |||
24 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/CircuitComponent.java 2015-06-26 22:23:53 +0000 | |||
25 | @@ -44,6 +44,10 @@ | |||
26 | 44 | @VisualClass(org.workcraft.plugins.circuit.VisualCircuitComponent.class) | 44 | @VisualClass(org.workcraft.plugins.circuit.VisualCircuitComponent.class) |
27 | 45 | public class CircuitComponent extends MathGroup implements Container, ObservableHierarchy { | 45 | public class CircuitComponent extends MathGroup implements Container, ObservableHierarchy { |
28 | 46 | 46 | ||
29 | 47 | public static final String PROPERTY_NAME = "Name"; | ||
30 | 48 | public static final String PROPERTY_IS_ENVIRONMENT = "Treat as environment"; | ||
31 | 49 | public static final String PROPERTY_IS_ZERO_DELAY = "Zero delay"; | ||
32 | 50 | |||
33 | 47 | private final class CircuitHierarchySupervisor extends HierarchySupervisor { | 51 | private final class CircuitHierarchySupervisor extends HierarchySupervisor { |
34 | 48 | @Override | 52 | @Override |
35 | 49 | public void handleEvent(HierarchyEvent e) { | 53 | public void handleEvent(HierarchyEvent e) { |
36 | @@ -79,7 +83,7 @@ | |||
37 | 79 | 83 | ||
38 | 80 | public void setIsEnvironment(boolean value) { | 84 | public void setIsEnvironment(boolean value) { |
39 | 81 | this.isEnvironment = value; | 85 | this.isEnvironment = value; |
41 | 82 | sendNotification(new PropertyChangedEvent(this, "is environment")); | 86 | sendNotification(new PropertyChangedEvent(this, PROPERTY_IS_ENVIRONMENT)); |
42 | 83 | } | 87 | } |
43 | 84 | 88 | ||
44 | 85 | public boolean getIsEnvironment() { | 89 | public boolean getIsEnvironment() { |
45 | @@ -88,7 +92,7 @@ | |||
46 | 88 | 92 | ||
47 | 89 | public void setIsZeroDelay(boolean value) { | 93 | public void setIsZeroDelay(boolean value) { |
48 | 90 | this.isZeroDelay = value; | 94 | this.isZeroDelay = value; |
50 | 91 | sendNotification(new PropertyChangedEvent(this, "is zero delay")); | 95 | sendNotification(new PropertyChangedEvent(this, PROPERTY_IS_ZERO_DELAY)); |
51 | 92 | } | 96 | } |
52 | 93 | 97 | ||
53 | 94 | public boolean getIsZeroDelay() { | 98 | public boolean getIsZeroDelay() { |
54 | @@ -194,7 +198,7 @@ | |||
55 | 194 | 198 | ||
56 | 195 | public void setName(String name) { | 199 | public void setName(String name) { |
57 | 196 | this.name = name; | 200 | this.name = name; |
59 | 197 | sendNotification(new PropertyChangedEvent(this, "name")); | 201 | sendNotification(new PropertyChangedEvent(this, PROPERTY_NAME)); |
60 | 198 | } | 202 | } |
61 | 199 | 203 | ||
62 | 200 | public String getName() { | 204 | public String getName() { |
63 | 201 | 205 | ||
64 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/Contact.java' | |||
65 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/Contact.java 2015-05-15 14:41:05 +0000 | |||
66 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/Contact.java 2015-06-26 22:23:53 +0000 | |||
67 | @@ -30,10 +30,10 @@ | |||
68 | 30 | @VisualClass(org.workcraft.plugins.circuit.VisualContact.class) | 30 | @VisualClass(org.workcraft.plugins.circuit.VisualContact.class) |
69 | 31 | public class Contact extends MathNode implements BooleanVariable { | 31 | public class Contact extends MathNode implements BooleanVariable { |
70 | 32 | 32 | ||
75 | 33 | public static final String PROPERTY_INIT_TO_ONE = "init to one"; | 33 | public static final String PROPERTY_INIT_TO_ONE = "Init to one"; |
76 | 34 | public static final String PROPERTY_IO_TYPE = "IO type"; | 34 | public static final String PROPERTY_IO_TYPE = "I/O type"; |
77 | 35 | 35 | public static final String PROPERTY_NAME = "Name"; | |
78 | 36 | public static final String PROPERTY_NAME = "name"; | 36 | |
79 | 37 | public enum IOType { | 37 | public enum IOType { |
80 | 38 | INPUT("Input"), | 38 | INPUT("Input"), |
81 | 39 | OUTPUT("Output"); | 39 | OUTPUT("Output"); |
82 | 40 | 40 | ||
83 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/Environment.java' | |||
84 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/Environment.java 2015-02-09 10:46:28 +0000 | |||
85 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/Environment.java 2015-06-26 22:23:53 +0000 | |||
86 | @@ -6,6 +6,8 @@ | |||
87 | 6 | import org.workcraft.observation.PropertyChangedEvent; | 6 | import org.workcraft.observation.PropertyChangedEvent; |
88 | 7 | 7 | ||
89 | 8 | public class Environment extends MathNode { | 8 | public class Environment extends MathNode { |
90 | 9 | public static final String PROPERTY_FILE = "file"; | ||
91 | 10 | public static final String PROPERTY_BASE = "base"; | ||
92 | 9 | private File file; | 11 | private File file; |
93 | 10 | private File base; | 12 | private File base; |
94 | 11 | 13 | ||
95 | @@ -19,7 +21,7 @@ | |||
96 | 19 | 21 | ||
97 | 20 | public void setFile(File file) { | 22 | public void setFile(File file) { |
98 | 21 | this.file = file; | 23 | this.file = file; |
100 | 22 | sendNotification(new PropertyChangedEvent(this, "file")); | 24 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FILE)); |
101 | 23 | } | 25 | } |
102 | 24 | 26 | ||
103 | 25 | public File getBase() { | 27 | public File getBase() { |
104 | @@ -28,7 +30,7 @@ | |||
105 | 28 | 30 | ||
106 | 29 | public void setBase(File base) { | 31 | public void setBase(File base) { |
107 | 30 | this.base = base; | 32 | this.base = base; |
109 | 31 | sendNotification(new PropertyChangedEvent(this, "base")); | 33 | sendNotification(new PropertyChangedEvent(this, PROPERTY_BASE)); |
110 | 32 | } | 34 | } |
111 | 33 | 35 | ||
112 | 34 | } | 36 | } |
113 | 35 | 37 | ||
114 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionContact.java' | |||
115 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionContact.java 2014-09-05 14:09:00 +0000 | |||
116 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/FunctionContact.java 2015-06-26 22:23:53 +0000 | |||
117 | @@ -27,6 +27,9 @@ | |||
118 | 27 | 27 | ||
119 | 28 | @VisualClass(org.workcraft.plugins.circuit.VisualFunctionContact.class) | 28 | @VisualClass(org.workcraft.plugins.circuit.VisualFunctionContact.class) |
120 | 29 | public class FunctionContact extends Contact { | 29 | public class FunctionContact extends Contact { |
121 | 30 | public static final String PROPERTY_SET_FUNCTION = "Set function"; | ||
122 | 31 | public static final String PROPERTY_RESET_FUNCTION = "Reset function"; | ||
123 | 32 | |||
124 | 30 | private BooleanFormula setFunction = null; | 33 | private BooleanFormula setFunction = null; |
125 | 31 | private BooleanFormula resetFunction = null; | 34 | private BooleanFormula resetFunction = null; |
126 | 32 | 35 | ||
127 | @@ -44,7 +47,7 @@ | |||
128 | 44 | 47 | ||
129 | 45 | public void setSetFunction(BooleanFormula setFunction) { | 48 | public void setSetFunction(BooleanFormula setFunction) { |
130 | 46 | this.setFunction = setFunction; | 49 | this.setFunction = setFunction; |
132 | 47 | sendNotification(new PropertyChangedEvent(this, "setFunction")); | 50 | sendNotification(new PropertyChangedEvent(this, PROPERTY_SET_FUNCTION)); |
133 | 48 | } | 51 | } |
134 | 49 | 52 | ||
135 | 50 | public BooleanFormula getResetFunction() { | 53 | public BooleanFormula getResetFunction() { |
136 | @@ -53,7 +56,7 @@ | |||
137 | 53 | 56 | ||
138 | 54 | public void setResetFunction(BooleanFormula resetFunction) { | 57 | public void setResetFunction(BooleanFormula resetFunction) { |
139 | 55 | this.resetFunction = resetFunction; | 58 | this.resetFunction = resetFunction; |
141 | 56 | sendNotification(new PropertyChangedEvent(this, "resetFunction")); | 59 | sendNotification(new PropertyChangedEvent(this, PROPERTY_RESET_FUNCTION)); |
142 | 57 | } | 60 | } |
143 | 58 | 61 | ||
144 | 59 | } | 62 | } |
145 | 60 | 63 | ||
146 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java' | |||
147 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java 2015-05-22 17:42:39 +0000 | |||
148 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/VisualCircuitComponent.java 2015-06-26 22:23:53 +0000 | |||
149 | @@ -74,6 +74,8 @@ | |||
150 | 74 | @SVGIcon("images/icons/svg/circuit-component.svg") | 74 | @SVGIcon("images/icons/svg/circuit-component.svg") |
151 | 75 | public class VisualCircuitComponent extends VisualComponent implements | 75 | public class VisualCircuitComponent extends VisualComponent implements |
152 | 76 | Container, CustomTouchable, StateObserver, ObservableHierarchy { | 76 | Container, CustomTouchable, StateObserver, ObservableHierarchy { |
153 | 77 | public static final String PROPERTY_RENDER_TYPE = "Render type"; | ||
154 | 78 | |||
155 | 77 | private Color inputColor = VisualContact.inputColor; | 79 | private Color inputColor = VisualContact.inputColor; |
156 | 78 | private Color outputColor = VisualContact.outputColor; | 80 | private Color outputColor = VisualContact.outputColor; |
157 | 79 | 81 | ||
158 | @@ -97,7 +99,7 @@ | |||
159 | 97 | 99 | ||
160 | 98 | private void addPropertyDeclarations() { | 100 | private void addPropertyDeclarations() { |
161 | 99 | addPropertyDeclaration(new PropertyDeclaration<VisualCircuitComponent, Boolean>( | 101 | addPropertyDeclaration(new PropertyDeclaration<VisualCircuitComponent, Boolean>( |
163 | 100 | this, "Treat as environment", Boolean.class) { | 102 | this, CircuitComponent.PROPERTY_IS_ENVIRONMENT, Boolean.class) { |
164 | 101 | protected void setter(VisualCircuitComponent object, Boolean value) { | 103 | protected void setter(VisualCircuitComponent object, Boolean value) { |
165 | 102 | object.setIsEnvironment(value); | 104 | object.setIsEnvironment(value); |
166 | 103 | } | 105 | } |
167 | @@ -108,7 +110,7 @@ | |||
168 | 108 | }); | 110 | }); |
169 | 109 | //TODO: Complete support for zero-delay buffers and inverters. | 111 | //TODO: Complete support for zero-delay buffers and inverters. |
170 | 110 | // addPropertyDeclaration(new PropertyDeclaration<VisualCircuitComponent, Boolean>( | 112 | // addPropertyDeclaration(new PropertyDeclaration<VisualCircuitComponent, Boolean>( |
172 | 111 | // this, "Zero delay", Boolean.class) { | 113 | // this, CircuitComponent.PROPERTY_IS_ZERO_DELAY, Boolean.class) { |
173 | 112 | // protected void setter(VisualCircuitComponent object, Boolean value) { | 114 | // protected void setter(VisualCircuitComponent object, Boolean value) { |
174 | 113 | // object.setIsZeroDelay(value); | 115 | // object.setIsZeroDelay(value); |
175 | 114 | // } | 116 | // } |
176 | @@ -119,7 +121,7 @@ | |||
177 | 119 | // }); | 121 | // }); |
178 | 120 | 122 | ||
179 | 121 | addPropertyDeclaration(new PropertyDeclaration<VisualCircuitComponent, RenderType>( | 123 | addPropertyDeclaration(new PropertyDeclaration<VisualCircuitComponent, RenderType>( |
181 | 122 | this, "Render type", RenderType.class) { | 124 | this, PROPERTY_RENDER_TYPE, RenderType.class) { |
182 | 123 | protected void setter(VisualCircuitComponent object, RenderType value) { | 125 | protected void setter(VisualCircuitComponent object, RenderType value) { |
183 | 124 | object.setRenderType(value); | 126 | object.setRenderType(value); |
184 | 125 | } | 127 | } |
185 | @@ -197,7 +199,7 @@ | |||
186 | 197 | this.renderType = renderType; | 199 | this.renderType = renderType; |
187 | 198 | setContactsDefaultPosition(); | 200 | setContactsDefaultPosition(); |
188 | 199 | invalidateBoundingBox(); | 201 | invalidateBoundingBox(); |
190 | 200 | sendNotification(new PropertyChangedEvent(this, "render type")); | 202 | sendNotification(new PropertyChangedEvent(this, PROPERTY_RENDER_TYPE)); |
191 | 201 | } | 203 | } |
192 | 202 | } | 204 | } |
193 | 203 | 205 | ||
194 | @@ -795,11 +797,11 @@ | |||
195 | 795 | if (e instanceof PropertyChangedEvent) { | 797 | if (e instanceof PropertyChangedEvent) { |
196 | 796 | PropertyChangedEvent pc = (PropertyChangedEvent) e; | 798 | PropertyChangedEvent pc = (PropertyChangedEvent) e; |
197 | 797 | String propertyName = pc.getPropertyName(); | 799 | String propertyName = pc.getPropertyName(); |
203 | 798 | if (propertyName.equals("name") | 800 | if (propertyName.equals(Contact.PROPERTY_NAME) |
204 | 799 | || propertyName.equals("IOtype") | 801 | || propertyName.equals(Contact.PROPERTY_IO_TYPE) |
205 | 800 | || propertyName.equals("direction") | 802 | || propertyName.equals(VisualContact.PROPERTY_DIRECTION) |
206 | 801 | || propertyName.equals("setFunction") | 803 | || propertyName.equals(FunctionContact.PROPERTY_SET_FUNCTION) |
207 | 802 | || propertyName.equals("resetFunction")) { | 804 | || propertyName.equals(FunctionContact.PROPERTY_RESET_FUNCTION)) { |
208 | 803 | 805 | ||
209 | 804 | for (Node node : getChildren()) { | 806 | for (Node node : getChildren()) { |
210 | 805 | if (node instanceof VisualFunctionContact) { | 807 | if (node instanceof VisualFunctionContact) { |
211 | 806 | 808 | ||
212 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContact.java' | |||
213 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContact.java 2015-04-23 18:20:32 +0000 | |||
214 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContact.java 2015-06-26 22:23:53 +0000 | |||
215 | @@ -50,6 +50,8 @@ | |||
216 | 50 | 50 | ||
217 | 51 | public class VisualContact extends VisualComponent implements StateObserver { | 51 | public class VisualContact extends VisualComponent implements StateObserver { |
218 | 52 | 52 | ||
219 | 53 | public static final String PROPERTY_DIRECTION = "Direction"; | ||
220 | 54 | |||
221 | 53 | public enum Direction { | 55 | public enum Direction { |
222 | 54 | WEST("West"), | 56 | WEST("West"), |
223 | 55 | NORTH("North"), | 57 | NORTH("North"), |
224 | @@ -151,7 +153,7 @@ | |||
225 | 151 | 153 | ||
226 | 152 | private void addPropertyDeclarations() { | 154 | private void addPropertyDeclarations() { |
227 | 153 | addPropertyDeclaration(new PropertyDeclaration<VisualContact, Direction>( | 155 | addPropertyDeclaration(new PropertyDeclaration<VisualContact, Direction>( |
229 | 154 | this, "Direction", Direction.class) { | 156 | this, PROPERTY_DIRECTION, Direction.class) { |
230 | 155 | protected void setter(VisualContact object, Direction value) { | 157 | protected void setter(VisualContact object, Direction value) { |
231 | 156 | object.setDirection(value); | 158 | object.setDirection(value); |
232 | 157 | } | 159 | } |
233 | @@ -161,7 +163,7 @@ | |||
234 | 161 | }); | 163 | }); |
235 | 162 | 164 | ||
236 | 163 | addPropertyDeclaration(new PropertyDeclaration<VisualContact, IOType>( | 165 | addPropertyDeclaration(new PropertyDeclaration<VisualContact, IOType>( |
238 | 164 | this, "I/O type", IOType.class, true, true, false) { | 166 | this, Contact.PROPERTY_IO_TYPE, IOType.class, true, true, false) { |
239 | 165 | protected void setter(VisualContact object, IOType value) { | 167 | protected void setter(VisualContact object, IOType value) { |
240 | 166 | object.getReferencedContact().setIOType(value); | 168 | object.getReferencedContact().setIOType(value); |
241 | 167 | } | 169 | } |
242 | @@ -171,7 +173,7 @@ | |||
243 | 171 | }); | 173 | }); |
244 | 172 | 174 | ||
245 | 173 | addPropertyDeclaration(new PropertyDeclaration<VisualContact, Boolean>( | 175 | addPropertyDeclaration(new PropertyDeclaration<VisualContact, Boolean>( |
247 | 174 | this, "Init to one", Boolean.class) { | 176 | this, Contact.PROPERTY_INIT_TO_ONE, Boolean.class) { |
248 | 175 | protected void setter(VisualContact object, Boolean value) { | 177 | protected void setter(VisualContact object, Boolean value) { |
249 | 176 | object.getReferencedContact().setInitToOne(value); | 178 | object.getReferencedContact().setInitToOne(value); |
250 | 177 | } | 179 | } |
251 | @@ -322,7 +324,7 @@ | |||
252 | 322 | if (value != direction) { | 324 | if (value != direction) { |
253 | 323 | sendNotification(new TransformChangingEvent(this)); | 325 | sendNotification(new TransformChangingEvent(this)); |
254 | 324 | this.direction = value; | 326 | this.direction = value; |
256 | 325 | sendNotification(new PropertyChangedEvent(this, "direction")); | 327 | sendNotification(new PropertyChangedEvent(this, PROPERTY_DIRECTION)); |
257 | 326 | sendNotification(new TransformChangedEvent(this)); | 328 | sendNotification(new TransformChangedEvent(this)); |
258 | 327 | } | 329 | } |
259 | 328 | } | 330 | } |
260 | 329 | 331 | ||
261 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContactFormulaProperties.java' | |||
262 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContactFormulaProperties.java 2015-04-13 18:41:37 +0000 | |||
263 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/VisualContactFormulaProperties.java 2015-06-26 22:23:53 +0000 | |||
264 | @@ -50,7 +50,7 @@ | |||
265 | 50 | @Override | 50 | @Override |
266 | 51 | public void setValue(Object value) throws InvocationTargetException { | 51 | public void setValue(Object value) throws InvocationTargetException { |
267 | 52 | String setFunction = (String)value; | 52 | String setFunction = (String)value; |
269 | 53 | if (!setFunction.equals("")) { | 53 | if (!setFunction.isEmpty()) { |
270 | 54 | contact.setSetFunction(parseFormula(contact, setFunction)); | 54 | contact.setSetFunction(parseFormula(contact, setFunction)); |
271 | 55 | } else { | 55 | } else { |
272 | 56 | contact.setSetFunction(null); | 56 | contact.setSetFunction(null); |
273 | @@ -100,7 +100,7 @@ | |||
274 | 100 | @Override | 100 | @Override |
275 | 101 | public void setValue(Object value) throws InvocationTargetException { | 101 | public void setValue(Object value) throws InvocationTargetException { |
276 | 102 | String setFunction = (String)value; | 102 | String setFunction = (String)value; |
278 | 103 | if (!setFunction.equals("")) { | 103 | if (!setFunction.isEmpty()) { |
279 | 104 | contact.setResetFunction(parseFormula(contact, setFunction)); | 104 | contact.setResetFunction(parseFormula(contact, setFunction)); |
280 | 105 | } else { | 105 | } else { |
281 | 106 | contact.setResetFunction(null); | 106 | contact.setResetFunction(null); |
282 | 107 | 107 | ||
283 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java' | |||
284 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java 2015-05-23 21:39:28 +0000 | |||
285 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionComponent.java 2015-06-26 22:23:53 +0000 | |||
286 | @@ -165,7 +165,7 @@ | |||
287 | 165 | super.notify(e); | 165 | super.notify(e); |
288 | 166 | if (e instanceof PropertyChangedEvent) { | 166 | if (e instanceof PropertyChangedEvent) { |
289 | 167 | PropertyChangedEvent pc = (PropertyChangedEvent)e; | 167 | PropertyChangedEvent pc = (PropertyChangedEvent)e; |
291 | 168 | if (pc.getPropertyName().equals("direction")) { | 168 | if (pc.getPropertyName().equals(VisualContact.PROPERTY_DIRECTION)) { |
292 | 169 | if ((getMainContact() == pc.getSender()) && (getRenderingResult() != null)) { | 169 | if ((getMainContact() == pc.getSender()) && (getRenderingResult() != null)) { |
293 | 170 | setContactsDefaultPosition(); | 170 | setContactsDefaultPosition(); |
294 | 171 | } | 171 | } |
295 | 172 | 172 | ||
296 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionContact.java' | |||
297 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionContact.java 2015-02-18 16:25:29 +0000 | |||
298 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/VisualFunctionContact.java 2015-06-26 22:23:53 +0000 | |||
299 | @@ -326,10 +326,11 @@ | |||
300 | 326 | public void notify(StateEvent e) { | 326 | public void notify(StateEvent e) { |
301 | 327 | if (e instanceof PropertyChangedEvent) { | 327 | if (e instanceof PropertyChangedEvent) { |
302 | 328 | PropertyChangedEvent pc = (PropertyChangedEvent)e; | 328 | PropertyChangedEvent pc = (PropertyChangedEvent)e; |
304 | 329 | if (pc.getPropertyName().equals("setFunction") || pc.getPropertyName().equals("resetFunction")) { | 329 | String propertyName = pc.getPropertyName(); |
305 | 330 | if (propertyName.equals(FunctionContact.PROPERTY_SET_FUNCTION) || propertyName.equals(FunctionContact.PROPERTY_RESET_FUNCTION)) { | ||
306 | 330 | invalidateRenderedFormula(); | 331 | invalidateRenderedFormula(); |
307 | 331 | } | 332 | } |
309 | 332 | if (pc.getPropertyName().equals("name")) { | 333 | if (propertyName.equals(Contact.PROPERTY_NAME)) { |
310 | 333 | for (VisualFunctionContact vc : getAllContacts()) { | 334 | for (VisualFunctionContact vc : getAllContacts()) { |
311 | 334 | vc.invalidateRenderedFormula(); | 335 | vc.invalidateRenderedFormula(); |
312 | 335 | } | 336 | } |
313 | 336 | 337 | ||
314 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/references/CircuitReferenceManager.java' | |||
315 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/references/CircuitReferenceManager.java 2014-09-27 20:09:17 +0000 | |||
316 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/references/CircuitReferenceManager.java 2015-06-26 22:23:53 +0000 | |||
317 | @@ -35,17 +35,16 @@ | |||
318 | 35 | public void setName(Node node, String name) { | 35 | public void setName(Node node, String name) { |
319 | 36 | // support for the older models | 36 | // support for the older models |
320 | 37 | if (Identifier.isNumber(name) && node instanceof Contact) { | 37 | if (Identifier.isNumber(name) && node instanceof Contact) { |
324 | 38 | String n = ((Contact)node).getName(); | 38 | String nodeName = ((Contact)node).getName(); |
325 | 39 | if ((n != null) && !n.equals("")) { | 39 | if ((nodeName != null) && !nodeName.isEmpty()) { |
326 | 40 | name = n; | 40 | name = nodeName; |
327 | 41 | } | 41 | } |
328 | 42 | } else if (Identifier.isNumber(name) && node instanceof CircuitComponent) { | 42 | } else if (Identifier.isNumber(name) && node instanceof CircuitComponent) { |
332 | 43 | String n = ((CircuitComponent)node).getName(); | 43 | String nodeName = ((CircuitComponent)node).getName(); |
333 | 44 | if ((n != null) && !n.equals("")) { | 44 | if ((nodeName != null) && !nodeName.isEmpty()) { |
334 | 45 | name = n; | 45 | name = nodeName; |
335 | 46 | } | 46 | } |
336 | 47 | } else if (Identifier.isNumber(name)) { | 47 | } else if (Identifier.isNumber(name)) { |
337 | 48 | // name="_"+name; | ||
338 | 49 | name = getPrefix(node) + name; | 48 | name = getPrefix(node) + name; |
339 | 50 | } | 49 | } |
340 | 51 | if (node instanceof Contact) { | 50 | if (node instanceof Contact) { |
341 | 52 | 51 | ||
342 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionDeserializer.java' | |||
343 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionDeserializer.java 2010-10-26 23:44:40 +0000 | |||
344 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionDeserializer.java 2015-06-26 22:23:53 +0000 | |||
345 | @@ -23,16 +23,6 @@ | |||
346 | 23 | ReferenceResolver internalReferenceResolver, | 23 | ReferenceResolver internalReferenceResolver, |
347 | 24 | ReferenceResolver externalReferenceResolver, | 24 | ReferenceResolver externalReferenceResolver, |
348 | 25 | NodeFinaliser nodeFinaliser) throws DeserialisationException { | 25 | NodeFinaliser nodeFinaliser) throws DeserialisationException { |
349 | 26 | |||
350 | 27 | /* VisualCircuitConnection vc = (VisualCircuitConnection) instance; | ||
351 | 28 | |||
352 | 29 | vc.setVisualConnectionDependencies( | ||
353 | 30 | (VisualComponent)externalReferenceResolver.getObject(element.getAttribute("first")), | ||
354 | 31 | (VisualComponent)externalReferenceResolver.getObject(element.getAttribute("second")), | ||
355 | 32 | new Polyline(vc), | ||
356 | 33 | (CircuitConnection)externalReferenceResolver.getObject(element.getAttribute("ref")) | ||
357 | 34 | );*/ | ||
358 | 35 | |||
359 | 36 | } | 26 | } |
360 | 37 | 27 | ||
361 | 38 | @Override | 28 | @Override |
362 | 39 | 29 | ||
363 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionSerializer.java' | |||
364 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionSerializer.java 2010-10-26 23:44:40 +0000 | |||
365 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/CircuitConnectionSerializer.java 2015-06-26 22:23:53 +0000 | |||
366 | @@ -14,11 +14,6 @@ | |||
367 | 14 | ReferenceProducer internalReferences, | 14 | ReferenceProducer internalReferences, |
368 | 15 | ReferenceProducer externalReferences, NodeSerialiser nodeSerialiser) | 15 | ReferenceProducer externalReferences, NodeSerialiser nodeSerialiser) |
369 | 16 | throws SerialisationException { | 16 | throws SerialisationException { |
370 | 17 | |||
371 | 18 | /* VisualCircuitConnection vc = (VisualCircuitConnection) object; | ||
372 | 19 | element.setAttribute("first", internalReferences.getReference(vc.getFirst())); | ||
373 | 20 | element.setAttribute("second", internalReferences.getReference(vc.getSecond())); | ||
374 | 21 | */ | ||
375 | 22 | } | 17 | } |
376 | 23 | 18 | ||
377 | 24 | @Override | 19 | @Override |
378 | 25 | 20 | ||
379 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/FunctionSerialiser.java' | |||
380 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/FunctionSerialiser.java 2010-10-26 23:44:40 +0000 | |||
381 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/serialisation/FunctionSerialiser.java 2015-06-26 22:23:53 +0000 | |||
382 | @@ -35,8 +35,7 @@ | |||
383 | 35 | public static final String SET_FUNCTION_ATTRIBUTE_NAME = "setFunction"; | 35 | public static final String SET_FUNCTION_ATTRIBUTE_NAME = "setFunction"; |
384 | 36 | 36 | ||
385 | 37 | @Override | 37 | @Override |
388 | 38 | public String getClassName() | 38 | public String getClassName() { |
387 | 39 | { | ||
389 | 40 | return org.workcraft.plugins.circuit.FunctionContact.class.getName(); | 39 | return org.workcraft.plugins.circuit.FunctionContact.class.getName(); |
390 | 41 | } | 40 | } |
391 | 42 | 41 | ||
392 | @@ -47,7 +46,11 @@ | |||
393 | 47 | throws SerialisationException { | 46 | throws SerialisationException { |
394 | 48 | FunctionContact function = (FunctionContact) object; | 47 | FunctionContact function = (FunctionContact) object; |
395 | 49 | 48 | ||
398 | 50 | BooleanFormulaSerialiser.writeFormulaAttribute(element, internalReferences, function.getSetFunction(), SET_FUNCTION_ATTRIBUTE_NAME); | 49 | BooleanFormulaSerialiser.writeFormulaAttribute(element, internalReferences, |
399 | 51 | BooleanFormulaSerialiser.writeFormulaAttribute(element, internalReferences, function.getResetFunction(), RESET_FUNCTION_ATTRIBUTE_NAME); | 50 | function.getSetFunction(), SET_FUNCTION_ATTRIBUTE_NAME); |
400 | 51 | |||
401 | 52 | BooleanFormulaSerialiser.writeFormulaAttribute(element, internalReferences, | ||
402 | 53 | function.getResetFunction(), RESET_FUNCTION_ATTRIBUTE_NAME); | ||
403 | 52 | } | 54 | } |
404 | 53 | } | ||
405 | 54 | \ No newline at end of file | 55 | \ No newline at end of file |
406 | 56 | |||
407 | 57 | } | ||
408 | 55 | 58 | ||
409 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/stg/CircuitStgUtils.java' | |||
410 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/stg/CircuitStgUtils.java 2015-04-28 17:37:41 +0000 | |||
411 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/stg/CircuitStgUtils.java 2015-06-26 22:23:53 +0000 | |||
412 | @@ -17,11 +17,16 @@ | |||
413 | 17 | import org.workcraft.tasks.Result; | 17 | import org.workcraft.tasks.Result; |
414 | 18 | import org.workcraft.tasks.Result.Outcome; | 18 | import org.workcraft.tasks.Result.Outcome; |
415 | 19 | import org.workcraft.util.Export; | 19 | import org.workcraft.util.Export; |
416 | 20 | import org.workcraft.util.Export.ExportTask; | ||
417 | 20 | import org.workcraft.util.FileUtils; | 21 | import org.workcraft.util.FileUtils; |
418 | 21 | import org.workcraft.util.Export.ExportTask; | ||
419 | 22 | import org.workcraft.workspace.WorkspaceEntry; | 22 | import org.workcraft.workspace.WorkspaceEntry; |
420 | 23 | 23 | ||
421 | 24 | public class CircuitStgUtils { | 24 | public class CircuitStgUtils { |
422 | 25 | public static final String TEMP_DIRECTORY_PREFIX = "workcraft-"; | ||
423 | 26 | public static final String DEVICE_FILE_NAME = "device"; | ||
424 | 27 | public static final String ENVIRONMENT_FILE_NAME = "environment"; | ||
425 | 28 | public static final String SYSTEM_FILE_NAME = "system"; | ||
426 | 29 | public static final String ASTG_FILE_EXT = ".g"; | ||
427 | 25 | 30 | ||
428 | 26 | public static CircuitToStgConverter createCircuitToStgConverter(VisualCircuit circuit) { | 31 | public static CircuitToStgConverter createCircuitToStgConverter(VisualCircuit circuit) { |
429 | 27 | CircuitToStgConverter generator = new CircuitToStgConverter(circuit); | 32 | CircuitToStgConverter generator = new CircuitToStgConverter(circuit); |
430 | @@ -39,7 +44,7 @@ | |||
431 | 39 | public static VisualSTG composeDevStgWithEvnFile(VisualSTG devStg, File envFile) { | 44 | public static VisualSTG composeDevStgWithEvnFile(VisualSTG devStg, File envFile) { |
432 | 40 | VisualSTG resultStg = null; | 45 | VisualSTG resultStg = null; |
433 | 41 | Framework framework = Framework.getInstance(); | 46 | Framework framework = Framework.getInstance(); |
435 | 42 | File workingDirectory = FileUtils.createTempDirectory("workcraft-"); | 47 | File workingDirectory = FileUtils.createTempDirectory(TEMP_DIRECTORY_PREFIX); |
436 | 43 | try { | 48 | try { |
437 | 44 | File devStgFile = exportDevStg(devStg, workingDirectory); | 49 | File devStgFile = exportDevStg(devStg, workingDirectory); |
438 | 45 | File envStgFile = exportEnvStg(envFile, workingDirectory); | 50 | File envStgFile = exportEnvStg(envFile, workingDirectory); |
439 | @@ -62,7 +67,7 @@ | |||
440 | 62 | Framework framework = Framework.getInstance(); | 67 | Framework framework = Framework.getInstance(); |
441 | 63 | if ((devStgFile != null) && (envStgFile != null)) { | 68 | if ((devStgFile != null) && (envStgFile != null)) { |
442 | 64 | // Generating .g for the whole system (circuit and environment) | 69 | // Generating .g for the whole system (circuit and environment) |
444 | 65 | stgFile = new File(workingDirectory, "system.g"); | 70 | stgFile = new File(workingDirectory, SYSTEM_FILE_NAME + ASTG_FILE_EXT); |
445 | 66 | PcompTask pcompTask = new PcompTask(new File[]{devStgFile, envStgFile}, | 71 | PcompTask pcompTask = new PcompTask(new File[]{devStgFile, envStgFile}, |
446 | 67 | ConversionMode.OUTPUT, true, false, workingDirectory); | 72 | ConversionMode.OUTPUT, true, false, workingDirectory); |
447 | 68 | 73 | ||
448 | @@ -81,12 +86,12 @@ | |||
449 | 81 | private static File exportEnvStg(File envFile, File workingDirectory) throws DeserialisationException, IOException { | 86 | private static File exportEnvStg(File envFile, File workingDirectory) throws DeserialisationException, IOException { |
450 | 82 | Framework framework = Framework.getInstance(); | 87 | Framework framework = Framework.getInstance(); |
451 | 83 | File envStgFile = null; | 88 | File envStgFile = null; |
453 | 84 | if (envFile.getName().endsWith(".g")) { | 89 | if (envFile.getName().endsWith(ASTG_FILE_EXT)) { |
454 | 85 | envStgFile = envFile; | 90 | envStgFile = envFile; |
455 | 86 | } else { | 91 | } else { |
456 | 87 | STG envStg = (STG)framework.loadFile(envFile).getMathModel(); | 92 | STG envStg = (STG)framework.loadFile(envFile).getMathModel(); |
457 | 88 | Exporter envStgExporter = Export.chooseBestExporter(framework.getPluginManager(), envStg, Format.STG); | 93 | Exporter envStgExporter = Export.chooseBestExporter(framework.getPluginManager(), envStg, Format.STG); |
459 | 89 | envStgFile = new File(workingDirectory, "env.g"); | 94 | envStgFile = new File(workingDirectory, ENVIRONMENT_FILE_NAME + ASTG_FILE_EXT); |
460 | 90 | ExportTask envExportTask = new ExportTask(envStgExporter, envStg, envStgFile.getCanonicalPath()); | 95 | ExportTask envExportTask = new ExportTask(envStgExporter, envStg, envStgFile.getCanonicalPath()); |
461 | 91 | Result<? extends Object> envExportResult = framework.getTaskManager().execute( | 96 | Result<? extends Object> envExportResult = framework.getTaskManager().execute( |
462 | 92 | envExportTask, "Exporting environment .g", null); | 97 | envExportTask, "Exporting environment .g", null); |
463 | @@ -103,14 +108,13 @@ | |||
464 | 103 | STG devStg = (STG)visualStg.getMathModel(); | 108 | STG devStg = (STG)visualStg.getMathModel(); |
465 | 104 | Exporter devStgExporter = Export.chooseBestExporter(framework.getPluginManager(), devStg, Format.STG); | 109 | Exporter devStgExporter = Export.chooseBestExporter(framework.getPluginManager(), devStg, Format.STG); |
466 | 105 | if (devStgExporter == null) { | 110 | if (devStgExporter == null) { |
468 | 106 | throw new RuntimeException ("Exporter not available: model class " + devStg.getClass().getName() + " to format STG."); | 111 | throw new RuntimeException("Exporter not available: model class " + devStg.getClass().getName() + " to .g format."); |
469 | 107 | } | 112 | } |
470 | 108 | 113 | ||
473 | 109 | String devStgName = "dev.g"; | 114 | File devStgFile = new File(workingDirectory, DEVICE_FILE_NAME + ASTG_FILE_EXT); |
472 | 110 | File devStgFile = new File(workingDirectory, devStgName); | ||
474 | 111 | ExportTask devExportTask = new ExportTask(devStgExporter, devStg, devStgFile.getCanonicalPath()); | 115 | ExportTask devExportTask = new ExportTask(devStgExporter, devStg, devStgFile.getCanonicalPath()); |
475 | 112 | Result<? extends Object> devExportResult = framework.getTaskManager().execute( | 116 | Result<? extends Object> devExportResult = framework.getTaskManager().execute( |
477 | 113 | devExportTask, "Exporting circuit .g", null); | 117 | devExportTask, "Exporting device .g", null); |
478 | 114 | if (devExportResult.getOutcome() != Outcome.FINISHED) { | 118 | if (devExportResult.getOutcome() != Outcome.FINISHED) { |
479 | 115 | devStgFile = null; | 119 | devStgFile = null; |
480 | 116 | } | 120 | } |
481 | 117 | 121 | ||
482 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/tasks/CheckCircuitTask.java' | |||
483 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/tasks/CheckCircuitTask.java 2015-04-30 23:14:48 +0000 | |||
484 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/tasks/CheckCircuitTask.java 2015-06-26 22:23:53 +0000 | |||
485 | @@ -12,6 +12,7 @@ | |||
486 | 12 | import org.workcraft.Framework; | 12 | import org.workcraft.Framework; |
487 | 13 | import org.workcraft.interop.Exporter; | 13 | import org.workcraft.interop.Exporter; |
488 | 14 | import org.workcraft.plugins.circuit.VisualCircuit; | 14 | import org.workcraft.plugins.circuit.VisualCircuit; |
489 | 15 | import org.workcraft.plugins.circuit.stg.CircuitStgUtils; | ||
490 | 15 | import org.workcraft.plugins.circuit.stg.CircuitToStgConverter; | 16 | import org.workcraft.plugins.circuit.stg.CircuitToStgConverter; |
491 | 16 | import org.workcraft.plugins.mpsat.MpsatMode; | 17 | import org.workcraft.plugins.mpsat.MpsatMode; |
492 | 17 | import org.workcraft.plugins.mpsat.MpsatResultParser; | 18 | import org.workcraft.plugins.mpsat.MpsatResultParser; |
493 | @@ -77,20 +78,20 @@ | |||
494 | 77 | File envFile = visualCircuit.getEnvironmentFile(); | 78 | File envFile = visualCircuit.getEnvironmentFile(); |
495 | 78 | boolean hasEnvironment = ((envFile != null) && envFile.exists()); | 79 | boolean hasEnvironment = ((envFile != null) && envFile.exists()); |
496 | 79 | 80 | ||
498 | 80 | String prefix = "workcraft-" + title + "-"; // Prefix must be at least 3 symbols long. | 81 | String prefix = CircuitStgUtils.TEMP_DIRECTORY_PREFIX + title + "-"; // Prefix must be at least 3 symbols long. |
499 | 81 | workingDirectory = FileUtils.createTempDirectory(prefix); | 82 | workingDirectory = FileUtils.createTempDirectory(prefix); |
500 | 82 | 83 | ||
501 | 83 | CircuitToStgConverter generator = new CircuitToStgConverter(visualCircuit); | 84 | CircuitToStgConverter generator = new CircuitToStgConverter(visualCircuit); |
502 | 84 | STG devStg = (STG)generator.getStg().getMathModel(); | 85 | STG devStg = (STG)generator.getStg().getMathModel(); |
503 | 85 | Exporter devStgExporter = Export.chooseBestExporter(framework.getPluginManager(), devStg, Format.STG); | 86 | Exporter devStgExporter = Export.chooseBestExporter(framework.getPluginManager(), devStg, Format.STG); |
504 | 86 | if (devStgExporter == null) { | 87 | if (devStgExporter == null) { |
506 | 87 | throw new RuntimeException ("Exporter not available: model class " + devStg.getClass().getName() + " to format STG."); | 88 | throw new RuntimeException("Exporter not available: model class " + devStg.getClass().getName() + " to .g format."); |
507 | 88 | } | 89 | } |
508 | 89 | SubtaskMonitor<Object> subtaskMonitor = new SubtaskMonitor<Object>(monitor); | 90 | SubtaskMonitor<Object> subtaskMonitor = new SubtaskMonitor<Object>(monitor); |
509 | 90 | monitor.progressUpdate(0.10); | 91 | monitor.progressUpdate(0.10); |
510 | 91 | 92 | ||
511 | 92 | // Generating .g for the circuit | 93 | // Generating .g for the circuit |
513 | 93 | String devStgName = (hasEnvironment ? "dev.g" : "system.g"); | 94 | String devStgName = (hasEnvironment ? CircuitStgUtils.DEVICE_FILE_NAME : CircuitStgUtils.SYSTEM_FILE_NAME) + CircuitStgUtils.ASTG_FILE_EXT; |
514 | 94 | File devStgFile = new File(workingDirectory, devStgName); | 95 | File devStgFile = new File(workingDirectory, devStgName); |
515 | 95 | ExportTask devExportTask = new ExportTask(devStgExporter, devStg, devStgFile.getCanonicalPath()); | 96 | ExportTask devExportTask = new ExportTask(devStgExporter, devStg, devStgFile.getCanonicalPath()); |
516 | 96 | Result<? extends Object> devExportResult = framework.getTaskManager().execute( | 97 | Result<? extends Object> devExportResult = framework.getTaskManager().execute( |
517 | @@ -114,12 +115,12 @@ | |||
518 | 114 | stg = devStg; | 115 | stg = devStg; |
519 | 115 | } else { | 116 | } else { |
520 | 116 | File envStgFile = null; | 117 | File envStgFile = null; |
522 | 117 | if (envFile.getName().endsWith(".g")) { | 118 | if (envFile.getName().endsWith(CircuitStgUtils.ASTG_FILE_EXT)) { |
523 | 118 | envStgFile = envFile; | 119 | envStgFile = envFile; |
524 | 119 | } else { | 120 | } else { |
525 | 120 | STG envStg = (STG)framework.loadFile(envFile).getMathModel(); | 121 | STG envStg = (STG)framework.loadFile(envFile).getMathModel(); |
526 | 121 | Exporter envStgExporter = Export.chooseBestExporter(framework.getPluginManager(), envStg, Format.STG); | 122 | Exporter envStgExporter = Export.chooseBestExporter(framework.getPluginManager(), envStg, Format.STG); |
528 | 122 | envStgFile = new File(workingDirectory, "env.g"); | 123 | envStgFile = new File(workingDirectory, CircuitStgUtils.ENVIRONMENT_FILE_NAME + CircuitStgUtils.ASTG_FILE_EXT); |
529 | 123 | ExportTask envExportTask = new ExportTask(envStgExporter, envStg, envStgFile.getCanonicalPath()); | 124 | ExportTask envExportTask = new ExportTask(envStgExporter, envStg, envStgFile.getCanonicalPath()); |
530 | 124 | Result<? extends Object> envExportResult = framework.getTaskManager().execute( | 125 | Result<? extends Object> envExportResult = framework.getTaskManager().execute( |
531 | 125 | envExportTask, "Exporting environment .g", subtaskMonitor); | 126 | envExportTask, "Exporting environment .g", subtaskMonitor); |
532 | @@ -135,7 +136,7 @@ | |||
533 | 135 | monitor.progressUpdate(0.25); | 136 | monitor.progressUpdate(0.25); |
534 | 136 | 137 | ||
535 | 137 | // Generating .g for the whole system (circuit and environment) | 138 | // Generating .g for the whole system (circuit and environment) |
537 | 138 | stgFile = new File(workingDirectory, "system.g"); | 139 | stgFile = new File(workingDirectory, CircuitStgUtils.SYSTEM_FILE_NAME + CircuitStgUtils.ASTG_FILE_EXT); |
538 | 139 | PcompTask pcompTask = new PcompTask(new File[]{devStgFile, envStgFile}, ConversionMode.OUTPUT, true, false, workingDirectory); | 140 | PcompTask pcompTask = new PcompTask(new File[]{devStgFile, envStgFile}, ConversionMode.OUTPUT, true, false, workingDirectory); |
539 | 140 | pcompResult = framework.getTaskManager().execute( | 141 | pcompResult = framework.getTaskManager().execute( |
540 | 141 | pcompTask, "Running pcomp", subtaskMonitor); | 142 | pcompTask, "Running pcomp", subtaskMonitor); |
541 | @@ -155,7 +156,7 @@ | |||
542 | 155 | monitor.progressUpdate(0.30); | 156 | monitor.progressUpdate(0.30); |
543 | 156 | 157 | ||
544 | 157 | // Generate unfolding | 158 | // Generate unfolding |
546 | 158 | File unfoldingFile = new File(workingDirectory, "system" + MpsatUtilitySettings.getUnfoldingExtension(true)); | 159 | File unfoldingFile = new File(workingDirectory, CircuitStgUtils.SYSTEM_FILE_NAME + MpsatUtilitySettings.getUnfoldingExtension(true)); |
547 | 159 | PunfTask punfTask = new PunfTask(stgFile.getCanonicalPath(), unfoldingFile.getCanonicalPath(), true); | 160 | PunfTask punfTask = new PunfTask(stgFile.getCanonicalPath(), unfoldingFile.getCanonicalPath(), true); |
548 | 160 | Result<? extends ExternalProcessResult> punfResult = framework.getTaskManager().execute( | 161 | Result<? extends ExternalProcessResult> punfResult = framework.getTaskManager().execute( |
549 | 161 | punfTask, "Unfolding .g", subtaskMonitor); | 162 | punfTask, "Unfolding .g", subtaskMonitor); |
550 | 162 | 163 | ||
551 | === modified file 'CircuitPlugin/src/org/workcraft/plugins/circuit/tools/CheckCircuitTool.java' | |||
552 | --- CircuitPlugin/src/org/workcraft/plugins/circuit/tools/CheckCircuitTool.java 2015-04-23 12:19:54 +0000 | |||
553 | +++ CircuitPlugin/src/org/workcraft/plugins/circuit/tools/CheckCircuitTool.java 2015-06-26 22:23:53 +0000 | |||
554 | @@ -15,7 +15,7 @@ | |||
555 | 15 | 15 | ||
556 | 16 | @Override | 16 | @Override |
557 | 17 | public String getSection() { | 17 | public String getSection() { |
559 | 18 | return "Verification"; | 18 | return "!Verification"; |
560 | 19 | } | 19 | } |
561 | 20 | 20 | ||
562 | 21 | @Override | 21 | @Override |
563 | 22 | 22 | ||
564 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/Arc.java' | |||
565 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/Arc.java 2010-04-13 15:52:01 +0000 | |||
566 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/Arc.java 2015-06-26 22:23:53 +0000 | |||
567 | @@ -26,28 +26,25 @@ | |||
568 | 26 | import org.workcraft.plugins.cpog.optimisation.BooleanFormula; | 26 | import org.workcraft.plugins.cpog.optimisation.BooleanFormula; |
569 | 27 | import org.workcraft.plugins.cpog.optimisation.expressions.One; | 27 | import org.workcraft.plugins.cpog.optimisation.expressions.One; |
570 | 28 | 28 | ||
573 | 29 | public class Arc extends MathConnection | 29 | public class Arc extends MathConnection { |
574 | 30 | { | 30 | public static final String PROPERTY_CONDITION = "Condition"; |
575 | 31 | |||
576 | 31 | private BooleanFormula condition; | 32 | private BooleanFormula condition; |
577 | 32 | 33 | ||
580 | 33 | public Arc() | 34 | public Arc() { |
579 | 34 | { | ||
581 | 35 | } | 35 | } |
582 | 36 | 36 | ||
585 | 37 | public Arc(Vertex first, Vertex second) | 37 | public Arc(Vertex first, Vertex second) { |
584 | 38 | { | ||
586 | 39 | super(first, second); | 38 | super(first, second); |
587 | 40 | condition = One.instance(); | 39 | condition = One.instance(); |
588 | 41 | } | 40 | } |
589 | 42 | 41 | ||
592 | 43 | public void setCondition(BooleanFormula condition) | 42 | public void setCondition(BooleanFormula condition) { |
591 | 44 | { | ||
593 | 45 | this.condition = condition; | 43 | this.condition = condition; |
595 | 46 | sendNotification(new PropertyChangedEvent(this, "condition")); | 44 | sendNotification(new PropertyChangedEvent(this, PROPERTY_CONDITION)); |
596 | 47 | } | 45 | } |
597 | 48 | 46 | ||
600 | 49 | public BooleanFormula getCondition() | 47 | public BooleanFormula getCondition() { |
599 | 50 | { | ||
601 | 51 | return condition; | 48 | return condition; |
602 | 52 | } | 49 | } |
603 | 53 | } | 50 | } |
604 | 54 | 51 | ||
605 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/RhoClause.java' | |||
606 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/RhoClause.java 2014-09-19 16:15:28 +0000 | |||
607 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/RhoClause.java 2015-06-26 22:23:53 +0000 | |||
608 | @@ -28,13 +28,14 @@ | |||
609 | 28 | import org.workcraft.plugins.cpog.optimisation.expressions.BooleanOperations; | 28 | import org.workcraft.plugins.cpog.optimisation.expressions.BooleanOperations; |
610 | 29 | 29 | ||
611 | 30 | @VisualClass(org.workcraft.plugins.cpog.VisualRhoClause.class) | 30 | @VisualClass(org.workcraft.plugins.cpog.VisualRhoClause.class) |
614 | 31 | public class RhoClause extends MathNode | 31 | public class RhoClause extends MathNode { |
615 | 32 | { | 32 | public static final String PROPERTY_FORMULA = "Formula"; |
616 | 33 | |||
617 | 33 | private BooleanFormula formula = BooleanOperations.ONE; | 34 | private BooleanFormula formula = BooleanOperations.ONE; |
618 | 34 | 35 | ||
619 | 35 | public void setFormula(BooleanFormula formula) { | 36 | public void setFormula(BooleanFormula formula) { |
620 | 36 | this.formula = formula; | 37 | this.formula = formula; |
622 | 37 | sendNotification(new PropertyChangedEvent(this, "formula")); | 38 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FORMULA)); |
623 | 38 | } | 39 | } |
624 | 39 | 40 | ||
625 | 40 | public BooleanFormula getFormula() { | 41 | public BooleanFormula getFormula() { |
626 | 41 | 42 | ||
627 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/Variable.java' | |||
628 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/Variable.java 2014-09-19 16:15:28 +0000 | |||
629 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/Variable.java 2015-06-26 22:23:53 +0000 | |||
630 | @@ -28,16 +28,17 @@ | |||
631 | 28 | import org.workcraft.plugins.cpog.optimisation.expressions.BooleanVisitor; | 28 | import org.workcraft.plugins.cpog.optimisation.expressions.BooleanVisitor; |
632 | 29 | 29 | ||
633 | 30 | @VisualClass(org.workcraft.plugins.cpog.VisualVariable.class) | 30 | @VisualClass(org.workcraft.plugins.cpog.VisualVariable.class) |
636 | 31 | public class Variable extends MathNode implements Comparable<Variable>, BooleanVariable | 31 | public class Variable extends MathNode implements Comparable<Variable>, BooleanVariable { |
635 | 32 | { | ||
637 | 33 | 32 | ||
638 | 33 | public static final String PROPERTY_STATE = "State"; | ||
639 | 34 | |||
640 | 34 | private VariableState state = VariableState.UNDEFINED; | 35 | private VariableState state = VariableState.UNDEFINED; |
641 | 35 | 36 | ||
642 | 36 | private String label = ""; | 37 | private String label = ""; |
643 | 37 | 38 | ||
644 | 38 | public void setState(VariableState state) { | 39 | public void setState(VariableState state) { |
645 | 39 | this.state = state; | 40 | this.state = state; |
647 | 40 | sendNotification(new PropertyChangedEvent(this, "state")); | 41 | sendNotification(new PropertyChangedEvent(this, PROPERTY_STATE)); |
648 | 41 | } | 42 | } |
649 | 42 | 43 | ||
650 | 43 | public VariableState getState() { | 44 | public VariableState getState() { |
651 | 44 | 45 | ||
652 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/Vertex.java' | |||
653 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/Vertex.java 2014-09-19 16:15:28 +0000 | |||
654 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/Vertex.java 2015-06-26 22:23:53 +0000 | |||
655 | @@ -28,13 +28,14 @@ | |||
656 | 28 | import org.workcraft.plugins.cpog.optimisation.expressions.One; | 28 | import org.workcraft.plugins.cpog.optimisation.expressions.One; |
657 | 29 | 29 | ||
658 | 30 | @VisualClass(org.workcraft.plugins.cpog.VisualVertex.class) | 30 | @VisualClass(org.workcraft.plugins.cpog.VisualVertex.class) |
661 | 31 | public class Vertex extends MathNode | 31 | public class Vertex extends MathNode { |
662 | 32 | { | 32 | public static final String PROPERTY_CONDITION = "Condition"; |
663 | 33 | |||
664 | 33 | private BooleanFormula condition = One.instance(); | 34 | private BooleanFormula condition = One.instance(); |
665 | 34 | 35 | ||
666 | 35 | public void setCondition(BooleanFormula condition) { | 36 | public void setCondition(BooleanFormula condition) { |
667 | 36 | this.condition = condition; | 37 | this.condition = condition; |
669 | 37 | sendNotification(new PropertyChangedEvent(this, "condition")); | 38 | sendNotification(new PropertyChangedEvent(this, PROPERTY_CONDITION)); |
670 | 38 | } | 39 | } |
671 | 39 | 40 | ||
672 | 40 | public BooleanFormula getCondition() { | 41 | public BooleanFormula getCondition() { |
673 | 41 | 42 | ||
674 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/VisualArc.java' | |||
675 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/VisualArc.java 2014-10-28 16:22:12 +0000 | |||
676 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/VisualArc.java 2015-06-26 22:23:53 +0000 | |||
677 | @@ -49,8 +49,8 @@ | |||
678 | 49 | import org.workcraft.plugins.cpog.optimisation.expressions.Zero; | 49 | import org.workcraft.plugins.cpog.optimisation.expressions.Zero; |
679 | 50 | import org.workcraft.util.Geometry; | 50 | import org.workcraft.util.Geometry; |
680 | 51 | 51 | ||
683 | 52 | public class VisualArc extends VisualConnection | 52 | public class VisualArc extends VisualConnection { |
684 | 53 | { | 53 | public static final String PROPERTY_CONDITION = "condition"; |
685 | 54 | private static Font labelFont; | 54 | private static Font labelFont; |
686 | 55 | private Rectangle2D labelBB = null; | 55 | private Rectangle2D labelBB = null; |
687 | 56 | 56 | ||
688 | @@ -68,14 +68,12 @@ | |||
689 | 68 | } | 68 | } |
690 | 69 | } | 69 | } |
691 | 70 | 70 | ||
694 | 71 | public VisualArc(Arc mathConnection) | 71 | public VisualArc(Arc mathConnection) { |
693 | 72 | { | ||
695 | 73 | super(); | 72 | super(); |
696 | 74 | this.mathConnection = mathConnection; | 73 | this.mathConnection = mathConnection; |
697 | 75 | } | 74 | } |
698 | 76 | 75 | ||
701 | 77 | public VisualArc(Arc mathConnection, VisualVertex first, VisualVertex second) | 76 | public VisualArc(Arc mathConnection, VisualVertex first, VisualVertex second) { |
700 | 78 | { | ||
702 | 79 | super(mathConnection, first, second); | 77 | super(mathConnection, first, second); |
703 | 80 | this.mathConnection = mathConnection; | 78 | this.mathConnection = mathConnection; |
704 | 81 | } | 79 | } |
705 | @@ -86,8 +84,7 @@ | |||
706 | 86 | } | 84 | } |
707 | 87 | 85 | ||
708 | 88 | @Override | 86 | @Override |
711 | 89 | public Stroke getStroke() | 87 | public Stroke getStroke() { |
710 | 90 | { | ||
712 | 91 | BooleanFormula value = evaluate(); | 88 | BooleanFormula value = evaluate(); |
713 | 92 | 89 | ||
714 | 93 | if (value == Zero.instance()) | 90 | if (value == Zero.instance()) |
715 | @@ -98,8 +95,7 @@ | |||
716 | 98 | } | 95 | } |
717 | 99 | 96 | ||
718 | 100 | @Override | 97 | @Override |
721 | 101 | public Color getDrawColor() | 98 | public Color getDrawColor() { |
720 | 102 | { | ||
722 | 103 | BooleanFormula value = evaluate(); | 99 | BooleanFormula value = evaluate(); |
723 | 104 | 100 | ||
724 | 105 | if (value == Zero.instance() || value == One.instance()) return super.getDrawColor(); | 101 | if (value == Zero.instance() || value == One.instance()) return super.getDrawColor(); |
725 | @@ -107,20 +103,17 @@ | |||
726 | 107 | return Color.LIGHT_GRAY; | 103 | return Color.LIGHT_GRAY; |
727 | 108 | } | 104 | } |
728 | 109 | 105 | ||
731 | 110 | private BooleanFormula evaluate() | 106 | private BooleanFormula evaluate() { |
730 | 111 | { | ||
732 | 112 | BooleanFormula condition = getCondition(); | 107 | BooleanFormula condition = getCondition(); |
733 | 113 | 108 | ||
734 | 114 | condition = BooleanOperations.and(condition, ((VisualVertex) getFirst()).evaluate()); | 109 | condition = BooleanOperations.and(condition, ((VisualVertex) getFirst()).evaluate()); |
735 | 115 | condition = BooleanOperations.and(condition, ((VisualVertex) getSecond()).evaluate()); | 110 | condition = BooleanOperations.and(condition, ((VisualVertex) getSecond()).evaluate()); |
736 | 116 | 111 | ||
737 | 117 | return condition.accept( | 112 | return condition.accept( |
740 | 118 | new BooleanReplacer(new HashMap<BooleanVariable, BooleanFormula>()) | 113 | new BooleanReplacer(new HashMap<BooleanVariable, BooleanFormula>()) { |
739 | 119 | { | ||
741 | 120 | @Override | 114 | @Override |
742 | 121 | public BooleanFormula visit(BooleanVariable node) { | 115 | public BooleanFormula visit(BooleanVariable node) { |
745 | 122 | switch(((Variable)node).getState()) | 116 | switch(((Variable)node).getState()) { |
744 | 123 | { | ||
746 | 124 | case TRUE: | 117 | case TRUE: |
747 | 125 | return One.instance(); | 118 | return One.instance(); |
748 | 126 | case FALSE: | 119 | case FALSE: |
749 | @@ -133,15 +126,13 @@ | |||
750 | 133 | ); | 126 | ); |
751 | 134 | } | 127 | } |
752 | 135 | 128 | ||
755 | 136 | public void setCondition(BooleanFormula condition) | 129 | public void setCondition(BooleanFormula condition) { |
754 | 137 | { | ||
756 | 138 | mathConnection.setCondition(condition); | 130 | mathConnection.setCondition(condition); |
758 | 139 | sendNotification(new PropertyChangedEvent(this, "condition")); | 131 | sendNotification(new PropertyChangedEvent(this, PROPERTY_CONDITION)); |
759 | 140 | } | 132 | } |
760 | 141 | 133 | ||
761 | 142 | @Override | 134 | @Override |
764 | 143 | public void draw(DrawRequest r) | 135 | public void draw(DrawRequest r) { |
763 | 144 | { | ||
765 | 145 | labelBB = null; | 136 | labelBB = null; |
766 | 146 | 137 | ||
767 | 147 | if (getCondition() == One.instance()) return; | 138 | if (getCondition() == One.instance()) return; |
768 | @@ -158,8 +149,7 @@ | |||
769 | 158 | Point2D d = graphic.getDerivativeAt(0.5); | 149 | Point2D d = graphic.getDerivativeAt(0.5); |
770 | 159 | Point2D dd = graphic.getSecondDerivativeAt(0.5); | 150 | Point2D dd = graphic.getSecondDerivativeAt(0.5); |
771 | 160 | 151 | ||
774 | 161 | if (d.getX() < 0) | 152 | if (d.getX() < 0) { |
773 | 162 | { | ||
775 | 163 | d = Geometry.multiply(d, -1); | 153 | d = Geometry.multiply(d, -1); |
776 | 164 | //dd = Geometry.multiply(dd, -1); | 154 | //dd = Geometry.multiply(dd, -1); |
777 | 165 | } | 155 | } |
778 | @@ -180,21 +170,19 @@ | |||
779 | 180 | } | 170 | } |
780 | 181 | 171 | ||
781 | 182 | @Override | 172 | @Override |
784 | 183 | public Rectangle2D getBoundingBox() | 173 | public Rectangle2D getBoundingBox() { |
783 | 184 | { | ||
785 | 185 | return BoundingBoxHelper.union(super.getBoundingBox(), labelBB); | 174 | return BoundingBoxHelper.union(super.getBoundingBox(), labelBB); |
786 | 186 | } | 175 | } |
787 | 187 | 176 | ||
790 | 188 | public Rectangle2D getLabelBoundingBox() | 177 | public Rectangle2D getLabelBoundingBox() { |
789 | 189 | { | ||
791 | 190 | return labelBB; | 178 | return labelBB; |
792 | 191 | } | 179 | } |
793 | 192 | 180 | ||
794 | 193 | @Override | 181 | @Override |
797 | 194 | public boolean hitTest(Point2D pointInParentSpace) | 182 | public boolean hitTest(Point2D pointInParentSpace) { |
796 | 195 | { | ||
798 | 196 | if (labelBB != null && labelBB.contains(pointInParentSpace)) return true; | 183 | if (labelBB != null && labelBB.contains(pointInParentSpace)) return true; |
799 | 197 | 184 | ||
800 | 198 | return super.hitTest(pointInParentSpace); | 185 | return super.hitTest(pointInParentSpace); |
801 | 199 | } | 186 | } |
802 | 187 | |||
803 | 200 | } | 188 | } |
804 | 201 | 189 | ||
805 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenario.java' | |||
806 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenario.java 2015-02-26 11:59:35 +0000 | |||
807 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenario.java 2015-06-26 22:23:53 +0000 | |||
808 | @@ -27,6 +27,9 @@ | |||
809 | 27 | 27 | ||
810 | 28 | public class VisualScenario extends VisualGroup | 28 | public class VisualScenario extends VisualGroup |
811 | 29 | { | 29 | { |
812 | 30 | public static final String PROPERTY_ENCODING = "Encoding"; | ||
813 | 31 | public static final String PROPERTY_LABEL = "Label"; | ||
814 | 32 | |||
815 | 30 | private static final class ReverseComparator implements Comparator<Variable> | 33 | private static final class ReverseComparator implements Comparator<Variable> |
816 | 31 | { | 34 | { |
817 | 32 | @Override | 35 | @Override |
818 | @@ -65,7 +68,7 @@ | |||
819 | 65 | 68 | ||
820 | 66 | public VisualScenario() { | 69 | public VisualScenario() { |
821 | 67 | addPropertyDeclaration(new PropertyDeclaration<VisualScenario, String>( | 70 | addPropertyDeclaration(new PropertyDeclaration<VisualScenario, String>( |
823 | 68 | this, "Label", String.class) { | 71 | this, PROPERTY_LABEL, String.class) { |
824 | 69 | public void setter(VisualScenario object, String value) { | 72 | public void setter(VisualScenario object, String value) { |
825 | 70 | object.setLabel(value); | 73 | object.setLabel(value); |
826 | 71 | } | 74 | } |
827 | @@ -75,7 +78,7 @@ | |||
828 | 75 | }); | 78 | }); |
829 | 76 | 79 | ||
830 | 77 | addPropertyDeclaration(new PropertyDeclaration<VisualScenario, Encoding>( | 80 | addPropertyDeclaration(new PropertyDeclaration<VisualScenario, Encoding>( |
832 | 78 | this, "Encoding", Encoding.class) { | 81 | this, PROPERTY_ENCODING, Encoding.class) { |
833 | 79 | public void setter(VisualScenario object, Encoding value) { | 82 | public void setter(VisualScenario object, Encoding value) { |
834 | 80 | object.setEncoding(value); | 83 | object.setEncoding(value); |
835 | 81 | } | 84 | } |
836 | @@ -276,7 +279,7 @@ | |||
837 | 276 | 279 | ||
838 | 277 | public void setLabel(String label) { | 280 | public void setLabel(String label) { |
839 | 278 | this.label = label; | 281 | this.label = label; |
841 | 279 | sendNotification(new PropertyChangedEvent(this, "label")); | 282 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LABEL)); |
842 | 280 | } | 283 | } |
843 | 281 | 284 | ||
844 | 282 | public String getLabel() { | 285 | public String getLabel() { |
845 | @@ -285,7 +288,7 @@ | |||
846 | 285 | 288 | ||
847 | 286 | public void setEncoding(Encoding encoding) { | 289 | public void setEncoding(Encoding encoding) { |
848 | 287 | this.encoding = encoding; | 290 | this.encoding = encoding; |
850 | 288 | sendNotification(new PropertyChangedEvent(this, "encoding")); | 291 | sendNotification(new PropertyChangedEvent(this, PROPERTY_ENCODING)); |
851 | 289 | } | 292 | } |
852 | 290 | 293 | ||
853 | 291 | public Encoding getEncoding() { | 294 | public Encoding getEncoding() { |
854 | 292 | 295 | ||
855 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenarioPage.java' | |||
856 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenarioPage.java 2015-04-02 17:28:13 +0000 | |||
857 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/VisualScenarioPage.java 2015-06-26 22:23:53 +0000 | |||
858 | @@ -7,12 +7,14 @@ | |||
859 | 7 | 7 | ||
860 | 8 | public class VisualScenarioPage extends VisualPage { | 8 | public class VisualScenarioPage extends VisualPage { |
861 | 9 | 9 | ||
862 | 10 | public static final String PROPERTY_ENCODING = "Encoding"; | ||
863 | 11 | |||
864 | 10 | public VisualScenarioPage(MathNode refNode) { | 12 | public VisualScenarioPage(MathNode refNode) { |
865 | 11 | super(refNode); | 13 | super(refNode); |
866 | 12 | // TODO Auto-generated constructor stub | 14 | // TODO Auto-generated constructor stub |
867 | 13 | 15 | ||
868 | 14 | addPropertyDeclaration(new PropertyDeclaration<VisualScenarioPage, Encoding>( | 16 | addPropertyDeclaration(new PropertyDeclaration<VisualScenarioPage, Encoding>( |
870 | 15 | this, "Encoding", Encoding.class) { | 17 | this, PROPERTY_ENCODING, Encoding.class) { |
871 | 16 | public void setter(VisualScenarioPage object, Encoding value) { | 18 | public void setter(VisualScenarioPage object, Encoding value) { |
872 | 17 | object.setEncoding(value); | 19 | object.setEncoding(value); |
873 | 18 | } | 20 | } |
874 | @@ -26,7 +28,7 @@ | |||
875 | 26 | 28 | ||
876 | 27 | public void setEncoding(Encoding encoding) { | 29 | public void setEncoding(Encoding encoding) { |
877 | 28 | this.encoding = encoding; | 30 | this.encoding = encoding; |
879 | 29 | sendNotification(new PropertyChangedEvent(this, "encoding")); | 31 | sendNotification(new PropertyChangedEvent(this, PROPERTY_ENCODING)); |
880 | 30 | } | 32 | } |
881 | 31 | 33 | ||
882 | 32 | public Encoding getEncoding() { | 34 | public Encoding getEncoding() { |
883 | 33 | 35 | ||
884 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVariable.java' | |||
885 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVariable.java 2015-02-26 11:59:35 +0000 | |||
886 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVariable.java 2015-06-26 22:23:53 +0000 | |||
887 | @@ -50,6 +50,7 @@ | |||
888 | 50 | @DisplayName("Variable") | 50 | @DisplayName("Variable") |
889 | 51 | @SVGIcon("images/icons/svg/variable.svg") | 51 | @SVGIcon("images/icons/svg/variable.svg") |
890 | 52 | public class VisualVariable extends VisualComponent { | 52 | public class VisualVariable extends VisualComponent { |
891 | 53 | public static final String PROPERTY_LABEL = "Label"; | ||
892 | 53 | private static Font variableFont; | 54 | private static Font variableFont; |
893 | 54 | private static Font valueFont; | 55 | private static Font valueFont; |
894 | 55 | 56 | ||
895 | @@ -82,7 +83,7 @@ | |||
896 | 82 | public VisualVariable(Variable variable) { | 83 | public VisualVariable(Variable variable) { |
897 | 83 | super(variable); | 84 | super(variable); |
898 | 84 | addPropertyDeclaration(new PropertyDeclaration<VisualVariable, VariableState>( | 85 | addPropertyDeclaration(new PropertyDeclaration<VisualVariable, VariableState>( |
900 | 85 | this, "State", VariableState.class) { | 86 | this, Variable.PROPERTY_STATE, VariableState.class) { |
901 | 86 | public void setter(VisualVariable object, VariableState value) { | 87 | public void setter(VisualVariable object, VariableState value) { |
902 | 87 | object.setState(value); | 88 | object.setState(value); |
903 | 88 | } | 89 | } |
904 | @@ -155,7 +156,7 @@ | |||
905 | 155 | @Override | 156 | @Override |
906 | 156 | public void setLabel(String label) { | 157 | public void setLabel(String label) { |
907 | 157 | getMathVariable().setLabel(label); | 158 | getMathVariable().setLabel(label); |
909 | 158 | sendNotification(new PropertyChangedEvent(this, "label")); | 159 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LABEL)); |
910 | 159 | } | 160 | } |
911 | 160 | 161 | ||
912 | 161 | @Override | 162 | @Override |
913 | 162 | 163 | ||
914 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVertex.java' | |||
915 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVertex.java 2014-10-27 16:09:36 +0000 | |||
916 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/VisualVertex.java 2015-06-26 22:23:53 +0000 | |||
917 | @@ -55,6 +55,7 @@ | |||
918 | 55 | @DisplayName("Vertex") | 55 | @DisplayName("Vertex") |
919 | 56 | @SVGIcon("images/icons/svg/vertex.svg") | 56 | @SVGIcon("images/icons/svg/vertex.svg") |
920 | 57 | public class VisualVertex extends VisualComponent implements CpogFormulaVariable { | 57 | public class VisualVertex extends VisualComponent implements CpogFormulaVariable { |
921 | 58 | public static final String PROPERTY_CONDITION = "Condition"; | ||
922 | 58 | public static Font conditionFont; | 59 | public static Font conditionFont; |
923 | 59 | private RenderedFormula conditionRenderedFormula = new RenderedFormula("", One.instance(), conditionFont, getLabelPositioning(), getLabelOffset()); | 60 | private RenderedFormula conditionRenderedFormula = new RenderedFormula("", One.instance(), conditionFont, getLabelPositioning(), getLabelOffset()); |
924 | 60 | 61 | ||
925 | @@ -132,7 +133,7 @@ | |||
926 | 132 | 133 | ||
927 | 133 | public void setCondition(BooleanFormula condition) { | 134 | public void setCondition(BooleanFormula condition) { |
928 | 134 | getMathVertex().setCondition(condition); | 135 | getMathVertex().setCondition(condition); |
930 | 135 | sendNotification(new PropertyChangedEvent(this, "condition")); | 136 | sendNotification(new PropertyChangedEvent(this, PROPERTY_CONDITION)); |
931 | 136 | } | 137 | } |
932 | 137 | 138 | ||
933 | 138 | public BooleanFormula evaluate() { | 139 | public BooleanFormula evaluate() { |
934 | 139 | 140 | ||
935 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/gui/ScencoConfigurationDialog.java' | |||
936 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/gui/ScencoConfigurationDialog.java 2015-05-15 18:05:13 +0000 | |||
937 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/gui/ScencoConfigurationDialog.java 2015-06-26 22:23:53 +0000 | |||
938 | @@ -507,15 +507,16 @@ | |||
939 | 507 | Object[][] data = new Object[m][3]; | 507 | Object[][] data = new Object[m][3]; |
940 | 508 | for(int i=0; i<m; i++){ | 508 | for(int i=0; i<m; i++){ |
941 | 509 | String name; | 509 | String name; |
943 | 510 | if(scenarios.get(i).getLabel().equals("")){ | 510 | if(scenarios.get(i).getLabel().isEmpty()) { |
944 | 511 | name = "CPOG " + i; | 511 | name = "CPOG " + i; |
947 | 512 | } | 512 | } else{ |
946 | 513 | else{ | ||
948 | 514 | name = scenarios.get(i).getLabel(); | 513 | name = scenarios.get(i).getLabel(); |
949 | 515 | } | 514 | } |
950 | 516 | data[i][0] = name; | 515 | data[i][0] = name; |
951 | 517 | data[i][1] = ""; | 516 | data[i][1] = ""; |
953 | 518 | for(int j=0; j < Integer.valueOf(bitsText.getText()); j++) data[i][1] = data[i][1] + "X"; | 517 | for (int j = 0; j < Integer.valueOf(bitsText.getText()); j++) { |
954 | 518 | data[i][1] = data[i][1] + "X"; | ||
955 | 519 | } | ||
956 | 519 | } | 520 | } |
957 | 520 | encodingTable = new JTable(data, columnNames); | 521 | encodingTable = new JTable(data, columnNames); |
958 | 521 | MyTableCellRenderer renderer = new MyTableCellRenderer(); | 522 | MyTableCellRenderer renderer = new MyTableCellRenderer(); |
959 | 522 | 523 | ||
960 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/serialisation/BooleanFunctionDeserialiser.java' | |||
961 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/serialisation/BooleanFunctionDeserialiser.java 2014-07-11 09:35:42 +0000 | |||
962 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/serialisation/BooleanFunctionDeserialiser.java 2015-06-26 22:23:53 +0000 | |||
963 | @@ -87,8 +87,9 @@ | |||
964 | 87 | 87 | ||
965 | 88 | BooleanFormula formula=null; | 88 | BooleanFormula formula=null; |
966 | 89 | try { | 89 | try { |
968 | 90 | if (!string.equals("")) | 90 | if (!string.isEmpty()) { |
969 | 91 | formula = BooleanParser.parse(string, new VariableResolver(internalReferenceResolver)); | 91 | formula = BooleanParser.parse(string, new VariableResolver(internalReferenceResolver)); |
970 | 92 | } | ||
971 | 92 | } catch (ParseException e) { | 93 | } catch (ParseException e) { |
972 | 93 | throw new DeserialisationException(e); | 94 | throw new DeserialisationException(e); |
973 | 94 | } | 95 | } |
974 | 95 | 96 | ||
975 | === modified file 'CpogsPlugin/src/org/workcraft/plugins/cpog/tasks/ScencoTask.java' | |||
976 | --- CpogsPlugin/src/org/workcraft/plugins/cpog/tasks/ScencoTask.java 2015-05-15 18:05:13 +0000 | |||
977 | +++ CpogsPlugin/src/org/workcraft/plugins/cpog/tasks/ScencoTask.java 2015-06-26 22:23:53 +0000 | |||
978 | @@ -445,7 +445,7 @@ | |||
979 | 445 | System.out.println("Op-code selected for graphs:"); | 445 | System.out.println("Op-code selected for graphs:"); |
980 | 446 | for(int i=0; i<m; i++){ | 446 | for(int i=0; i<m; i++){ |
981 | 447 | String name; | 447 | String name; |
983 | 448 | if (scenarios.get(i).getLabel().equals("")) { | 448 | if (scenarios.get(i).getLabel().isEmpty()) { |
984 | 449 | name = "CPOG " + i; | 449 | name = "CPOG " + i; |
985 | 450 | } else { | 450 | } else { |
986 | 451 | name = scenarios.get(i).getLabel(); | 451 | name = scenarios.get(i).getLabel(); |
987 | @@ -832,11 +832,10 @@ | |||
988 | 832 | 832 | ||
989 | 833 | } | 833 | } |
990 | 834 | String empty = ""; | 834 | String empty = ""; |
993 | 835 | for(int i=0; i<settings.getBits(); i++) empty += 'X'; | 835 | for (int i=0; i<settings.getBits(); i++) empty += 'X'; |
994 | 836 | if(enc[k].equals("") || enc[k].equals(empty)){ | 836 | if (enc[k].isEmpty() || enc[k].equals(empty)){ |
995 | 837 | Output1.println("/"); | 837 | Output1.println("/"); |
998 | 838 | } | 838 | } else { |
997 | 839 | else{ | ||
999 | 840 | Output1.println(enc[k]); | 839 | Output1.println(enc[k]); |
1000 | 841 | } | 840 | } |
1001 | 842 | } | 841 | } |
1002 | 843 | 842 | ||
1003 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/BinaryRegister.java' | |||
1004 | --- DfsPlugin/src/org/workcraft/plugins/dfs/BinaryRegister.java 2015-01-09 12:41:39 +0000 | |||
1005 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/BinaryRegister.java 2015-06-26 22:23:53 +0000 | |||
1006 | @@ -4,6 +4,8 @@ | |||
1007 | 4 | 4 | ||
1008 | 5 | public class BinaryRegister extends MathDelayNode { | 5 | public class BinaryRegister extends MathDelayNode { |
1009 | 6 | 6 | ||
1010 | 7 | public static final String PROPERTY_MARKING = "Marking"; | ||
1011 | 8 | |||
1012 | 7 | public enum Marking { | 9 | public enum Marking { |
1013 | 8 | EMPTY("empty"), | 10 | EMPTY("empty"), |
1014 | 9 | FALSE_TOKEN("false"), | 11 | FALSE_TOKEN("false"), |
1015 | @@ -29,7 +31,7 @@ | |||
1016 | 29 | 31 | ||
1017 | 30 | public void setMarking(Marking value) { | 32 | public void setMarking(Marking value) { |
1018 | 31 | this.marking = value; | 33 | this.marking = value; |
1020 | 32 | sendNotification(new PropertyChangedEvent(this, "marking")); | 34 | sendNotification(new PropertyChangedEvent(this, PROPERTY_MARKING)); |
1021 | 33 | } | 35 | } |
1022 | 34 | 36 | ||
1023 | 35 | public boolean isFalseMarked() { | 37 | public boolean isFalseMarked() { |
1024 | 36 | 38 | ||
1025 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/ControlConnection.java' | |||
1026 | --- DfsPlugin/src/org/workcraft/plugins/dfs/ControlConnection.java 2013-09-10 09:54:55 +0000 | |||
1027 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/ControlConnection.java 2015-06-26 22:23:53 +0000 | |||
1028 | @@ -7,6 +7,7 @@ | |||
1029 | 7 | 7 | ||
1030 | 8 | @VisualClass(org.workcraft.plugins.dfs.VisualControlConnection.class) | 8 | @VisualClass(org.workcraft.plugins.dfs.VisualControlConnection.class) |
1031 | 9 | public class ControlConnection extends MathConnection { | 9 | public class ControlConnection extends MathConnection { |
1032 | 10 | public static final String PROPERTY_INVERTING = "Inverting"; | ||
1033 | 10 | private boolean inverting = false; | 11 | private boolean inverting = false; |
1034 | 11 | 12 | ||
1035 | 12 | public ControlConnection() { | 13 | public ControlConnection() { |
1036 | @@ -22,7 +23,7 @@ | |||
1037 | 22 | 23 | ||
1038 | 23 | public void setInverting(boolean value) { | 24 | public void setInverting(boolean value) { |
1039 | 24 | this.inverting = value; | 25 | this.inverting = value; |
1041 | 25 | sendNotification(new PropertyChangedEvent(this, "inverting")); | 26 | sendNotification(new PropertyChangedEvent(this, PROPERTY_INVERTING)); |
1042 | 26 | } | 27 | } |
1043 | 27 | 28 | ||
1044 | 28 | } | 29 | } |
1045 | 29 | 30 | ||
1046 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/ControlRegister.java' | |||
1047 | --- DfsPlugin/src/org/workcraft/plugins/dfs/ControlRegister.java 2015-01-09 12:41:39 +0000 | |||
1048 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/ControlRegister.java 2015-06-26 22:23:53 +0000 | |||
1049 | @@ -5,7 +5,9 @@ | |||
1050 | 5 | 5 | ||
1051 | 6 | @VisualClass(org.workcraft.plugins.dfs.VisualControlRegister.class) | 6 | @VisualClass(org.workcraft.plugins.dfs.VisualControlRegister.class) |
1052 | 7 | public class ControlRegister extends BinaryRegister { | 7 | public class ControlRegister extends BinaryRegister { |
1054 | 8 | 8 | public static final String PROPERTY_PROBABILITY = "Probability"; | |
1055 | 9 | public static final String PROPERTY_SYNCHRONISATION_TYPE = "Synchronisation type"; | ||
1056 | 10 | |||
1057 | 9 | private SynchronisationType synchronisationType = SynchronisationType.PLAIN; | 11 | private SynchronisationType synchronisationType = SynchronisationType.PLAIN; |
1058 | 10 | private double probability = 1.0; | 12 | private double probability = 1.0; |
1059 | 11 | 13 | ||
1060 | @@ -32,7 +34,7 @@ | |||
1061 | 32 | 34 | ||
1062 | 33 | public void setSynchronisationType(SynchronisationType value) { | 35 | public void setSynchronisationType(SynchronisationType value) { |
1063 | 34 | this.synchronisationType = value; | 36 | this.synchronisationType = value; |
1065 | 35 | sendNotification(new PropertyChangedEvent(this, "synchronisation type")); | 37 | sendNotification(new PropertyChangedEvent(this, PROPERTY_SYNCHRONISATION_TYPE)); |
1066 | 36 | } | 38 | } |
1067 | 37 | 39 | ||
1068 | 38 | public double getProbability() { | 40 | public double getProbability() { |
1069 | @@ -41,7 +43,7 @@ | |||
1070 | 41 | 43 | ||
1071 | 42 | public void setProbability(double value) { | 44 | public void setProbability(double value) { |
1072 | 43 | this.probability = value; | 45 | this.probability = value; |
1074 | 44 | sendNotification(new PropertyChangedEvent(this, "probability")); | 46 | sendNotification(new PropertyChangedEvent(this, PROPERTY_PROBABILITY)); |
1075 | 45 | } | 47 | } |
1076 | 46 | 48 | ||
1077 | 47 | } | 49 | } |
1078 | 48 | 50 | ||
1079 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowLogic.java' | |||
1080 | --- DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowLogic.java 2013-11-13 10:32:32 +0000 | |||
1081 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowLogic.java 2015-06-26 22:23:53 +0000 | |||
1082 | @@ -5,6 +5,10 @@ | |||
1083 | 5 | 5 | ||
1084 | 6 | @VisualClass(org.workcraft.plugins.dfs.VisualCounterflowLogic.class) | 6 | @VisualClass(org.workcraft.plugins.dfs.VisualCounterflowLogic.class) |
1085 | 7 | public class CounterflowLogic extends MathDelayNode { | 7 | public class CounterflowLogic extends MathDelayNode { |
1086 | 8 | public static final String PROPERTY_FORWARD_COMPUTED = "Forward computed"; | ||
1087 | 9 | public static final String PROPERTY_BACKWARD_COMPUTED = "Backward computed"; | ||
1088 | 10 | public static final String PROPERTY_FORWARD_EARLY_EVALUATION = "Forward early evaluation"; | ||
1089 | 11 | public static final String PROPERTY_BACKWARD_EARLY_EVALUATION = "Backward early evaluation"; | ||
1090 | 8 | private boolean forwardComputed = false; | 12 | private boolean forwardComputed = false; |
1091 | 9 | private boolean backwardComputed = false; | 13 | private boolean backwardComputed = false; |
1092 | 10 | private boolean forwardEarlyEvaluation = false; | 14 | private boolean forwardEarlyEvaluation = false; |
1093 | @@ -16,7 +20,7 @@ | |||
1094 | 16 | 20 | ||
1095 | 17 | public void setForwardComputed(boolean value) { | 21 | public void setForwardComputed(boolean value) { |
1096 | 18 | this.forwardComputed = value; | 22 | this.forwardComputed = value; |
1098 | 19 | sendNotification(new PropertyChangedEvent(this, "forward computed")); | 23 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FORWARD_COMPUTED)); |
1099 | 20 | } | 24 | } |
1100 | 21 | 25 | ||
1101 | 22 | public boolean isBackwardComputed() { | 26 | public boolean isBackwardComputed() { |
1102 | @@ -25,7 +29,7 @@ | |||
1103 | 25 | 29 | ||
1104 | 26 | public void setBackwardComputed(boolean value) { | 30 | public void setBackwardComputed(boolean value) { |
1105 | 27 | this.backwardComputed = value; | 31 | this.backwardComputed = value; |
1107 | 28 | sendNotification(new PropertyChangedEvent(this, "backward computed")); | 32 | sendNotification(new PropertyChangedEvent(this, PROPERTY_BACKWARD_COMPUTED)); |
1108 | 29 | } | 33 | } |
1109 | 30 | 34 | ||
1110 | 31 | public boolean isForwardEarlyEvaluation() { | 35 | public boolean isForwardEarlyEvaluation() { |
1111 | @@ -34,7 +38,7 @@ | |||
1112 | 34 | 38 | ||
1113 | 35 | public void setForwardEarlyEvaluation(boolean value) { | 39 | public void setForwardEarlyEvaluation(boolean value) { |
1114 | 36 | this.forwardEarlyEvaluation = value; | 40 | this.forwardEarlyEvaluation = value; |
1116 | 37 | sendNotification(new PropertyChangedEvent(this, "forward early evaluation")); | 41 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FORWARD_EARLY_EVALUATION)); |
1117 | 38 | } | 42 | } |
1118 | 39 | 43 | ||
1119 | 40 | public boolean isBackwardEarlyEvaluation() { | 44 | public boolean isBackwardEarlyEvaluation() { |
1120 | @@ -43,6 +47,6 @@ | |||
1121 | 43 | 47 | ||
1122 | 44 | public void setBackwardEarlyEvaluation(boolean value) { | 48 | public void setBackwardEarlyEvaluation(boolean value) { |
1123 | 45 | this.backwardEarlyEvaluation = value; | 49 | this.backwardEarlyEvaluation = value; |
1125 | 46 | sendNotification(new PropertyChangedEvent(this, "backward early evaluation")); | 50 | sendNotification(new PropertyChangedEvent(this, PROPERTY_BACKWARD_EARLY_EVALUATION)); |
1126 | 47 | } | 51 | } |
1127 | 48 | } | 52 | } |
1128 | 49 | 53 | ||
1129 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowRegister.java' | |||
1130 | --- DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowRegister.java 2013-11-13 10:32:32 +0000 | |||
1131 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/CounterflowRegister.java 2015-06-26 22:23:53 +0000 | |||
1132 | @@ -5,6 +5,8 @@ | |||
1133 | 5 | 5 | ||
1134 | 6 | @VisualClass(org.workcraft.plugins.dfs.VisualCounterflowRegister.class) | 6 | @VisualClass(org.workcraft.plugins.dfs.VisualCounterflowRegister.class) |
1135 | 7 | public class CounterflowRegister extends MathDelayNode { | 7 | public class CounterflowRegister extends MathDelayNode { |
1136 | 8 | public static final String PROPERTY_AND_MARKED = "And-marked"; | ||
1137 | 9 | public static final String PROPERTY_OR_MARKED = "Or-marked"; | ||
1138 | 8 | private boolean orMarked = false; | 10 | private boolean orMarked = false; |
1139 | 9 | private boolean andMarked = false; | 11 | private boolean andMarked = false; |
1140 | 10 | 12 | ||
1141 | @@ -14,7 +16,7 @@ | |||
1142 | 14 | 16 | ||
1143 | 15 | public void setOrMarked(boolean orMarked) { | 17 | public void setOrMarked(boolean orMarked) { |
1144 | 16 | this.orMarked = orMarked; | 18 | this.orMarked = orMarked; |
1146 | 17 | sendNotification(new PropertyChangedEvent(this, "or-marked")); | 19 | sendNotification(new PropertyChangedEvent(this, PROPERTY_OR_MARKED)); |
1147 | 18 | } | 20 | } |
1148 | 19 | 21 | ||
1149 | 20 | public boolean isAndMarked() { | 22 | public boolean isAndMarked() { |
1150 | @@ -23,7 +25,7 @@ | |||
1151 | 23 | 25 | ||
1152 | 24 | public void setAndMarked(boolean andMarked) { | 26 | public void setAndMarked(boolean andMarked) { |
1153 | 25 | this.andMarked = andMarked; | 27 | this.andMarked = andMarked; |
1155 | 26 | sendNotification(new PropertyChangedEvent(this, "and-marked")); | 28 | sendNotification(new PropertyChangedEvent(this, PROPERTY_AND_MARKED)); |
1156 | 27 | } | 29 | } |
1157 | 28 | 30 | ||
1158 | 29 | } | 31 | } |
1159 | 30 | 32 | ||
1160 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/Logic.java' | |||
1161 | --- DfsPlugin/src/org/workcraft/plugins/dfs/Logic.java 2013-11-13 10:32:32 +0000 | |||
1162 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/Logic.java 2015-06-26 22:23:53 +0000 | |||
1163 | @@ -26,6 +26,9 @@ | |||
1164 | 26 | 26 | ||
1165 | 27 | @VisualClass(org.workcraft.plugins.dfs.VisualLogic.class) | 27 | @VisualClass(org.workcraft.plugins.dfs.VisualLogic.class) |
1166 | 28 | public class Logic extends MathDelayNode { | 28 | public class Logic extends MathDelayNode { |
1167 | 29 | public static final String PROPERTY_EARLY_EVALUATION = "Early evaluation"; | ||
1168 | 30 | public static final String PROPERTY_COMPUTED = "Computed"; | ||
1169 | 31 | |||
1170 | 29 | private boolean computed = false; | 32 | private boolean computed = false; |
1171 | 30 | private boolean earlyEvaluation = false; | 33 | private boolean earlyEvaluation = false; |
1172 | 31 | 34 | ||
1173 | @@ -35,7 +38,7 @@ | |||
1174 | 35 | 38 | ||
1175 | 36 | public void setComputed(boolean value) { | 39 | public void setComputed(boolean value) { |
1176 | 37 | this.computed = value; | 40 | this.computed = value; |
1178 | 38 | sendNotification(new PropertyChangedEvent(this, "computed")); | 41 | sendNotification(new PropertyChangedEvent(this, PROPERTY_COMPUTED)); |
1179 | 39 | } | 42 | } |
1180 | 40 | 43 | ||
1181 | 41 | public boolean isEarlyEvaluation() { | 44 | public boolean isEarlyEvaluation() { |
1182 | @@ -44,7 +47,7 @@ | |||
1183 | 44 | 47 | ||
1184 | 45 | public void setEarlyEvaluation(boolean value) { | 48 | public void setEarlyEvaluation(boolean value) { |
1185 | 46 | this.earlyEvaluation = value; | 49 | this.earlyEvaluation = value; |
1187 | 47 | sendNotification(new PropertyChangedEvent(this, "early evaluation")); | 50 | sendNotification(new PropertyChangedEvent(this, PROPERTY_EARLY_EVALUATION)); |
1188 | 48 | } | 51 | } |
1189 | 49 | 52 | ||
1190 | 50 | } | 53 | } |
1191 | 51 | 54 | ||
1192 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/MathDelayNode.java' | |||
1193 | --- DfsPlugin/src/org/workcraft/plugins/dfs/MathDelayNode.java 2013-12-16 12:01:22 +0000 | |||
1194 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/MathDelayNode.java 2015-06-26 22:23:53 +0000 | |||
1195 | @@ -22,8 +22,11 @@ | |||
1196 | 22 | package org.workcraft.plugins.dfs; | 22 | package org.workcraft.plugins.dfs; |
1197 | 23 | 23 | ||
1198 | 24 | import org.workcraft.dom.math.MathNode; | 24 | import org.workcraft.dom.math.MathNode; |
1199 | 25 | import org.workcraft.observation.PropertyChangedEvent; | ||
1200 | 25 | 26 | ||
1201 | 26 | public class MathDelayNode extends MathNode { | 27 | public class MathDelayNode extends MathNode { |
1202 | 28 | public static final String PROPERTY_DELAY = "Delay"; | ||
1203 | 29 | |||
1204 | 27 | private double delay = 0.0; | 30 | private double delay = 0.0; |
1205 | 28 | 31 | ||
1206 | 29 | public double getDelay() { | 32 | public double getDelay() { |
1207 | @@ -32,6 +35,7 @@ | |||
1208 | 32 | 35 | ||
1209 | 33 | public void setDelay(double value) { | 36 | public void setDelay(double value) { |
1210 | 34 | this.delay = value; | 37 | this.delay = value; |
1211 | 38 | sendNotification(new PropertyChangedEvent(this, PROPERTY_DELAY)); | ||
1212 | 35 | } | 39 | } |
1213 | 36 | 40 | ||
1214 | 37 | } | 41 | } |
1215 | 38 | 42 | ||
1216 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/Register.java' | |||
1217 | --- DfsPlugin/src/org/workcraft/plugins/dfs/Register.java 2013-11-13 10:32:32 +0000 | |||
1218 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/Register.java 2015-06-26 22:23:53 +0000 | |||
1219 | @@ -25,6 +25,8 @@ | |||
1220 | 25 | 25 | ||
1221 | 26 | @VisualClass(org.workcraft.plugins.dfs.VisualRegister.class) | 26 | @VisualClass(org.workcraft.plugins.dfs.VisualRegister.class) |
1222 | 27 | public class Register extends MathDelayNode { | 27 | public class Register extends MathDelayNode { |
1223 | 28 | public static final String PROPERTY_MARKED = "Marked"; | ||
1224 | 29 | |||
1225 | 28 | private boolean marked = false; | 30 | private boolean marked = false; |
1226 | 29 | 31 | ||
1227 | 30 | public boolean isMarked() { | 32 | public boolean isMarked() { |
1228 | @@ -33,7 +35,7 @@ | |||
1229 | 33 | 35 | ||
1230 | 34 | public void setMarked(boolean marked) { | 36 | public void setMarked(boolean marked) { |
1231 | 35 | this.marked = marked; | 37 | this.marked = marked; |
1233 | 36 | sendNotification(new PropertyChangedEvent(this, "marked")); | 38 | sendNotification(new PropertyChangedEvent(this, PROPERTY_MARKED)); |
1234 | 37 | } | 39 | } |
1235 | 38 | 40 | ||
1236 | 39 | } | 41 | } |
1237 | 40 | 42 | ||
1238 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualAbstractRegister.java' | |||
1239 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualAbstractRegister.java 2015-01-20 15:37:33 +0000 | |||
1240 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualAbstractRegister.java 2015-06-26 22:23:53 +0000 | |||
1241 | @@ -4,9 +4,11 @@ | |||
1242 | 4 | 4 | ||
1243 | 5 | import org.workcraft.dom.visual.Stylable; | 5 | import org.workcraft.dom.visual.Stylable; |
1244 | 6 | import org.workcraft.gui.propertyeditor.PropertyDeclaration; | 6 | import org.workcraft.gui.propertyeditor.PropertyDeclaration; |
1245 | 7 | import org.workcraft.observation.PropertyChangedEvent; | ||
1246 | 7 | import org.workcraft.plugins.shared.CommonVisualSettings; | 8 | import org.workcraft.plugins.shared.CommonVisualSettings; |
1247 | 8 | 9 | ||
1248 | 9 | public abstract class VisualAbstractRegister extends VisualDelayComponent { | 10 | public abstract class VisualAbstractRegister extends VisualDelayComponent { |
1249 | 11 | public static final String PROPERTY_TOKEN_COLOR = "Token color"; | ||
1250 | 10 | protected Color tokenColor = CommonVisualSettings.getBorderColor(); | 12 | protected Color tokenColor = CommonVisualSettings.getBorderColor(); |
1251 | 11 | 13 | ||
1252 | 12 | public VisualAbstractRegister(MathDelayNode ref) { | 14 | public VisualAbstractRegister(MathDelayNode ref) { |
1253 | @@ -16,7 +18,7 @@ | |||
1254 | 16 | 18 | ||
1255 | 17 | private void addPropertyDeclarations() { | 19 | private void addPropertyDeclarations() { |
1256 | 18 | addPropertyDeclaration(new PropertyDeclaration<VisualAbstractRegister, Color>( | 20 | addPropertyDeclaration(new PropertyDeclaration<VisualAbstractRegister, Color>( |
1258 | 19 | this, "Token color", Color.class) { | 21 | this, PROPERTY_TOKEN_COLOR, Color.class) { |
1259 | 20 | public void setter(VisualAbstractRegister object, Color value) { | 22 | public void setter(VisualAbstractRegister object, Color value) { |
1260 | 21 | object.setTokenColor(value); | 23 | object.setTokenColor(value); |
1261 | 22 | } | 24 | } |
1262 | @@ -32,6 +34,7 @@ | |||
1263 | 32 | 34 | ||
1264 | 33 | public void setTokenColor(Color tokenColor) { | 35 | public void setTokenColor(Color tokenColor) { |
1265 | 34 | this.tokenColor = tokenColor; | 36 | this.tokenColor = tokenColor; |
1266 | 37 | sendNotification(new PropertyChangedEvent(this, PROPERTY_TOKEN_COLOR)); | ||
1267 | 35 | } | 38 | } |
1268 | 36 | 39 | ||
1269 | 37 | @Override | 40 | @Override |
1270 | 38 | 41 | ||
1271 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualBinaryRegister.java' | |||
1272 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualBinaryRegister.java 2015-01-20 15:37:33 +0000 | |||
1273 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualBinaryRegister.java 2015-06-26 22:23:53 +0000 | |||
1274 | @@ -13,7 +13,7 @@ | |||
1275 | 13 | 13 | ||
1276 | 14 | private void addPropertyDeclarations() { | 14 | private void addPropertyDeclarations() { |
1277 | 15 | addPropertyDeclaration(new PropertyDeclaration<VisualBinaryRegister, Marking>( | 15 | addPropertyDeclaration(new PropertyDeclaration<VisualBinaryRegister, Marking>( |
1279 | 16 | this, "Marking", Marking.class) { | 16 | this, BinaryRegister.PROPERTY_MARKING, Marking.class) { |
1280 | 17 | public void setter(VisualBinaryRegister object, Marking value) { | 17 | public void setter(VisualBinaryRegister object, Marking value) { |
1281 | 18 | object.getReferencedBinaryRegister().setMarking(value); | 18 | object.getReferencedBinaryRegister().setMarking(value); |
1282 | 19 | } | 19 | } |
1283 | 20 | 20 | ||
1284 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlConnection.java' | |||
1285 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlConnection.java 2015-01-20 15:37:33 +0000 | |||
1286 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlConnection.java 2015-06-26 22:23:53 +0000 | |||
1287 | @@ -24,7 +24,7 @@ | |||
1288 | 24 | private void addPropertyDeclarations() { | 24 | private void addPropertyDeclarations() { |
1289 | 25 | super.initialise(); | 25 | super.initialise(); |
1290 | 26 | addPropertyDeclaration(new PropertyDeclaration<VisualControlConnection, Boolean>( | 26 | addPropertyDeclaration(new PropertyDeclaration<VisualControlConnection, Boolean>( |
1292 | 27 | this, "Inverting", Boolean.class) { | 27 | this, ControlConnection.PROPERTY_INVERTING, Boolean.class) { |
1293 | 28 | public void setter(VisualControlConnection object, Boolean value) { | 28 | public void setter(VisualControlConnection object, Boolean value) { |
1294 | 29 | ControlConnection ref = getReferencedControlConnection(); | 29 | ControlConnection ref = getReferencedControlConnection(); |
1295 | 30 | // check if ref is not null to trick the order of node creation in deserialiser | 30 | // check if ref is not null to trick the order of node creation in deserialiser |
1296 | 31 | 31 | ||
1297 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlRegister.java' | |||
1298 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlRegister.java 2015-01-09 12:41:39 +0000 | |||
1299 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualControlRegister.java 2015-06-26 22:23:53 +0000 | |||
1300 | @@ -32,7 +32,7 @@ | |||
1301 | 32 | 32 | ||
1302 | 33 | private void addPropertyDeclarations() { | 33 | private void addPropertyDeclarations() { |
1303 | 34 | addPropertyDeclaration(new PropertyDeclaration<VisualControlRegister, Double>( | 34 | addPropertyDeclaration(new PropertyDeclaration<VisualControlRegister, Double>( |
1305 | 35 | this, "Probability", Double.class) { | 35 | this, ControlRegister.PROPERTY_PROBABILITY, Double.class) { |
1306 | 36 | public void setter(VisualControlRegister object, Double value) { | 36 | public void setter(VisualControlRegister object, Double value) { |
1307 | 37 | object.getReferencedControlRegister().setProbability(value); | 37 | object.getReferencedControlRegister().setProbability(value); |
1308 | 38 | } | 38 | } |
1309 | @@ -42,7 +42,7 @@ | |||
1310 | 42 | }); | 42 | }); |
1311 | 43 | 43 | ||
1312 | 44 | addPropertyDeclaration(new PropertyDeclaration<VisualControlRegister, SynchronisationType>( | 44 | addPropertyDeclaration(new PropertyDeclaration<VisualControlRegister, SynchronisationType>( |
1314 | 45 | this, "Synchronisation type", SynchronisationType.class) { | 45 | this, ControlRegister.PROPERTY_SYNCHRONISATION_TYPE, SynchronisationType.class) { |
1315 | 46 | public void setter(VisualControlRegister object, SynchronisationType value) { | 46 | public void setter(VisualControlRegister object, SynchronisationType value) { |
1316 | 47 | object.getReferencedControlRegister().setSynchronisationType(value); | 47 | object.getReferencedControlRegister().setSynchronisationType(value); |
1317 | 48 | } | 48 | } |
1318 | 49 | 49 | ||
1319 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowLogic.java' | |||
1320 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowLogic.java 2015-01-20 15:37:33 +0000 | |||
1321 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowLogic.java 2015-06-26 22:23:53 +0000 | |||
1322 | @@ -30,7 +30,7 @@ | |||
1323 | 30 | 30 | ||
1324 | 31 | private void addPropertyDeclarations() { | 31 | private void addPropertyDeclarations() { |
1325 | 32 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( | 32 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( |
1327 | 33 | this, "Forward Computed", Boolean.class) { | 33 | this, CounterflowLogic.PROPERTY_FORWARD_COMPUTED, Boolean.class) { |
1328 | 34 | public void setter(VisualCounterflowLogic object, Boolean value) { | 34 | public void setter(VisualCounterflowLogic object, Boolean value) { |
1329 | 35 | object.getReferencedCounterflowLogic().setForwardComputed(value); | 35 | object.getReferencedCounterflowLogic().setForwardComputed(value); |
1330 | 36 | } | 36 | } |
1331 | @@ -40,7 +40,7 @@ | |||
1332 | 40 | }); | 40 | }); |
1333 | 41 | 41 | ||
1334 | 42 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( | 42 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( |
1336 | 43 | this, "Backward Computed", Boolean.class) { | 43 | this, CounterflowLogic.PROPERTY_BACKWARD_COMPUTED, Boolean.class) { |
1337 | 44 | public void setter(VisualCounterflowLogic object, Boolean value) { | 44 | public void setter(VisualCounterflowLogic object, Boolean value) { |
1338 | 45 | object.getReferencedCounterflowLogic().setBackwardComputed(value); | 45 | object.getReferencedCounterflowLogic().setBackwardComputed(value); |
1339 | 46 | } | 46 | } |
1340 | @@ -51,7 +51,7 @@ | |||
1341 | 51 | 51 | ||
1342 | 52 | 52 | ||
1343 | 53 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( | 53 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( |
1345 | 54 | this, "Forward Early Evaluation", Boolean.class) { | 54 | this, CounterflowLogic.PROPERTY_FORWARD_EARLY_EVALUATION, Boolean.class) { |
1346 | 55 | public void setter(VisualCounterflowLogic object, Boolean value) { | 55 | public void setter(VisualCounterflowLogic object, Boolean value) { |
1347 | 56 | object.getReferencedCounterflowLogic().setForwardEarlyEvaluation(value); | 56 | object.getReferencedCounterflowLogic().setForwardEarlyEvaluation(value); |
1348 | 57 | } | 57 | } |
1349 | @@ -61,7 +61,7 @@ | |||
1350 | 61 | }); | 61 | }); |
1351 | 62 | 62 | ||
1352 | 63 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( | 63 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowLogic, Boolean>( |
1354 | 64 | this, "Backward Early Evaluation", Boolean.class) { | 64 | this, CounterflowLogic.PROPERTY_BACKWARD_EARLY_EVALUATION, Boolean.class) { |
1355 | 65 | public void setter(VisualCounterflowLogic object, Boolean value) { | 65 | public void setter(VisualCounterflowLogic object, Boolean value) { |
1356 | 66 | object.getReferencedCounterflowLogic().setBackwardEarlyEvaluation(value); | 66 | object.getReferencedCounterflowLogic().setBackwardEarlyEvaluation(value); |
1357 | 67 | } | 67 | } |
1358 | 68 | 68 | ||
1359 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowRegister.java' | |||
1360 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowRegister.java 2015-01-20 15:37:33 +0000 | |||
1361 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualCounterflowRegister.java 2015-06-26 22:23:53 +0000 | |||
1362 | @@ -30,7 +30,7 @@ | |||
1363 | 30 | 30 | ||
1364 | 31 | private void addPropertyDeclarations() { | 31 | private void addPropertyDeclarations() { |
1365 | 32 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowRegister, Boolean>( | 32 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowRegister, Boolean>( |
1367 | 33 | this, "Or-marked", Boolean.class) { | 33 | this, CounterflowRegister.PROPERTY_OR_MARKED, Boolean.class) { |
1368 | 34 | public void setter(VisualCounterflowRegister object, Boolean value) { | 34 | public void setter(VisualCounterflowRegister object, Boolean value) { |
1369 | 35 | object.getReferencedCounterflowRegister().setOrMarked(value); | 35 | object.getReferencedCounterflowRegister().setOrMarked(value); |
1370 | 36 | } | 36 | } |
1371 | @@ -40,7 +40,7 @@ | |||
1372 | 40 | }); | 40 | }); |
1373 | 41 | 41 | ||
1374 | 42 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowRegister, Boolean>( | 42 | addPropertyDeclaration(new PropertyDeclaration<VisualCounterflowRegister, Boolean>( |
1376 | 43 | this, "And-marked", Boolean.class) { | 43 | this, CounterflowRegister.PROPERTY_AND_MARKED, Boolean.class) { |
1377 | 44 | public void setter(VisualCounterflowRegister object, Boolean value) { | 44 | public void setter(VisualCounterflowRegister object, Boolean value) { |
1378 | 45 | object.getReferencedCounterflowRegister().setAndMarked(value); | 45 | object.getReferencedCounterflowRegister().setAndMarked(value); |
1379 | 46 | } | 46 | } |
1380 | 47 | 47 | ||
1381 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualDelayComponent.java' | |||
1382 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualDelayComponent.java 2015-01-20 15:37:33 +0000 | |||
1383 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualDelayComponent.java 2015-06-26 22:23:53 +0000 | |||
1384 | @@ -17,7 +17,7 @@ | |||
1385 | 17 | 17 | ||
1386 | 18 | private void addPropertyDeclarations() { | 18 | private void addPropertyDeclarations() { |
1387 | 19 | addPropertyDeclaration(new PropertyDeclaration<VisualDelayComponent, Double>( | 19 | addPropertyDeclaration(new PropertyDeclaration<VisualDelayComponent, Double>( |
1389 | 20 | this, "Delay", Double.class) { | 20 | this, MathDelayNode.PROPERTY_DELAY, Double.class) { |
1390 | 21 | public void setter(VisualDelayComponent object, Double value) { | 21 | public void setter(VisualDelayComponent object, Double value) { |
1391 | 22 | object.getReferencedDelayComponent().setDelay(value); | 22 | object.getReferencedDelayComponent().setDelay(value); |
1392 | 23 | } | 23 | } |
1393 | 24 | 24 | ||
1394 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualLogic.java' | |||
1395 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualLogic.java 2015-01-20 15:37:33 +0000 | |||
1396 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualLogic.java 2015-06-26 22:23:53 +0000 | |||
1397 | @@ -29,7 +29,7 @@ | |||
1398 | 29 | 29 | ||
1399 | 30 | private void addPropertyDeclarations() { | 30 | private void addPropertyDeclarations() { |
1400 | 31 | addPropertyDeclaration(new PropertyDeclaration<VisualLogic, Boolean>( | 31 | addPropertyDeclaration(new PropertyDeclaration<VisualLogic, Boolean>( |
1402 | 32 | this, "Computed", Boolean.class) { | 32 | this, Logic.PROPERTY_COMPUTED, Boolean.class) { |
1403 | 33 | public void setter(VisualLogic object, Boolean value) { | 33 | public void setter(VisualLogic object, Boolean value) { |
1404 | 34 | object.getReferencedLogic().setComputed(value); | 34 | object.getReferencedLogic().setComputed(value); |
1405 | 35 | } | 35 | } |
1406 | @@ -39,7 +39,7 @@ | |||
1407 | 39 | }); | 39 | }); |
1408 | 40 | 40 | ||
1409 | 41 | addPropertyDeclaration(new PropertyDeclaration<VisualLogic, Boolean>( | 41 | addPropertyDeclaration(new PropertyDeclaration<VisualLogic, Boolean>( |
1411 | 42 | this, "Early Evaluation", Boolean.class) { | 42 | this, Logic.PROPERTY_EARLY_EVALUATION, Boolean.class) { |
1412 | 43 | public void setter(VisualLogic object, Boolean value) { | 43 | public void setter(VisualLogic object, Boolean value) { |
1413 | 44 | object.getReferencedLogic().setEarlyEvaluation(value); | 44 | object.getReferencedLogic().setEarlyEvaluation(value); |
1414 | 45 | } | 45 | } |
1415 | 46 | 46 | ||
1416 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/VisualRegister.java' | |||
1417 | --- DfsPlugin/src/org/workcraft/plugins/dfs/VisualRegister.java 2015-01-20 15:37:33 +0000 | |||
1418 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/VisualRegister.java 2015-06-26 22:23:53 +0000 | |||
1419 | @@ -55,7 +55,7 @@ | |||
1420 | 55 | 55 | ||
1421 | 56 | private void addPropertyDeclarations() { | 56 | private void addPropertyDeclarations() { |
1422 | 57 | addPropertyDeclaration(new PropertyDeclaration<VisualRegister, Boolean>( | 57 | addPropertyDeclaration(new PropertyDeclaration<VisualRegister, Boolean>( |
1424 | 58 | this, "Marked", Boolean.class) { | 58 | this, Register.PROPERTY_MARKED, Boolean.class) { |
1425 | 59 | public void setter(VisualRegister object, Boolean value) { | 59 | public void setter(VisualRegister object, Boolean value) { |
1426 | 60 | object.getReferencedRegister().setMarked(value); | 60 | object.getReferencedRegister().setMarked(value); |
1427 | 61 | } | 61 | } |
1428 | 62 | 62 | ||
1429 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowDeadlockTool.java' | |||
1430 | --- DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowDeadlockTool.java 2015-04-23 12:19:54 +0000 | |||
1431 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowDeadlockTool.java 2015-06-26 22:23:53 +0000 | |||
1432 | @@ -16,7 +16,7 @@ | |||
1433 | 16 | 16 | ||
1434 | 17 | @Override | 17 | @Override |
1435 | 18 | public String getSection() { | 18 | public String getSection() { |
1437 | 19 | return "Verification"; | 19 | return "!Verification"; |
1438 | 20 | } | 20 | } |
1439 | 21 | 21 | ||
1440 | 22 | @Override | 22 | @Override |
1441 | 23 | 23 | ||
1442 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowHazardTool.java' | |||
1443 | --- DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowHazardTool.java 2015-04-23 12:19:54 +0000 | |||
1444 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowHazardTool.java 2015-06-26 22:23:53 +0000 | |||
1445 | @@ -15,7 +15,7 @@ | |||
1446 | 15 | 15 | ||
1447 | 16 | @Override | 16 | @Override |
1448 | 17 | public String getSection() { | 17 | public String getSection() { |
1450 | 18 | return "Verification"; | 18 | return "!Verification"; |
1451 | 19 | } | 19 | } |
1452 | 20 | 20 | ||
1453 | 21 | @Override | 21 | @Override |
1454 | 22 | 22 | ||
1455 | === modified file 'DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowTool.java' | |||
1456 | --- DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowTool.java 2015-04-23 12:19:54 +0000 | |||
1457 | +++ DfsPlugin/src/org/workcraft/plugins/dfs/tools/CheckDataflowTool.java 2015-06-26 22:23:53 +0000 | |||
1458 | @@ -15,7 +15,7 @@ | |||
1459 | 15 | 15 | ||
1460 | 16 | @Override | 16 | @Override |
1461 | 17 | public String getSection() { | 17 | public String getSection() { |
1463 | 18 | return "Verification"; | 18 | return "!Verification"; |
1464 | 19 | } | 19 | } |
1465 | 20 | 20 | ||
1466 | 21 | @Override | 21 | @Override |
1467 | 22 | 22 | ||
1468 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/Event.java' | |||
1469 | --- FsmPlugin/src/org/workcraft/plugins/fsm/Event.java 2015-01-08 23:08:14 +0000 | |||
1470 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/Event.java 2015-06-26 22:23:53 +0000 | |||
1471 | @@ -8,6 +8,7 @@ | |||
1472 | 8 | @DisplayName("Event") | 8 | @DisplayName("Event") |
1473 | 9 | @VisualClass(org.workcraft.plugins.fsm.VisualEvent.class) | 9 | @VisualClass(org.workcraft.plugins.fsm.VisualEvent.class) |
1474 | 10 | public class Event extends MathConnection { | 10 | public class Event extends MathConnection { |
1475 | 11 | public static final String PROPERTY_SYMBOL = "Symbol"; | ||
1476 | 11 | 12 | ||
1477 | 12 | private Symbol symbol; | 13 | private Symbol symbol; |
1478 | 13 | 14 | ||
1479 | @@ -25,7 +26,7 @@ | |||
1480 | 25 | 26 | ||
1481 | 26 | public void setSymbol(Symbol symbol) { | 27 | public void setSymbol(Symbol symbol) { |
1482 | 27 | this.symbol = symbol; | 28 | this.symbol = symbol; |
1484 | 28 | sendNotification(new PropertyChangedEvent(this, "symbol")); | 29 | sendNotification(new PropertyChangedEvent(this, PROPERTY_SYMBOL)); |
1485 | 29 | } | 30 | } |
1486 | 30 | 31 | ||
1487 | 31 | } | 32 | } |
1488 | 32 | 33 | ||
1489 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/Fsm.java' | |||
1490 | --- FsmPlugin/src/org/workcraft/plugins/fsm/Fsm.java 2015-05-27 12:14:35 +0000 | |||
1491 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/Fsm.java 2015-06-26 22:23:53 +0000 | |||
1492 | @@ -1,6 +1,7 @@ | |||
1493 | 1 | package org.workcraft.plugins.fsm; | 1 | package org.workcraft.plugins.fsm; |
1494 | 2 | 2 | ||
1495 | 3 | import java.util.Collection; | 3 | import java.util.Collection; |
1496 | 4 | import java.util.LinkedList; | ||
1497 | 4 | 5 | ||
1498 | 5 | import org.workcraft.annotations.VisualClass; | 6 | import org.workcraft.annotations.VisualClass; |
1499 | 6 | import org.workcraft.dom.Container; | 7 | import org.workcraft.dom.Container; |
1500 | @@ -12,6 +13,7 @@ | |||
1501 | 12 | import org.workcraft.dom.references.ReferenceManager; | 13 | import org.workcraft.dom.references.ReferenceManager; |
1502 | 13 | import org.workcraft.exceptions.ArgumentException; | 14 | import org.workcraft.exceptions.ArgumentException; |
1503 | 14 | import org.workcraft.gui.propertyeditor.ModelProperties; | 15 | import org.workcraft.gui.propertyeditor.ModelProperties; |
1504 | 16 | import org.workcraft.gui.propertyeditor.PropertyDescriptor; | ||
1505 | 15 | import org.workcraft.plugins.fsm.propertydescriptors.EventSymbolPropertyDescriptor; | 17 | import org.workcraft.plugins.fsm.propertydescriptors.EventSymbolPropertyDescriptor; |
1506 | 16 | import org.workcraft.plugins.fsm.propertydescriptors.SymbolPropertyDescriptor; | 18 | import org.workcraft.plugins.fsm.propertydescriptors.SymbolPropertyDescriptor; |
1507 | 17 | import org.workcraft.serialisation.References; | 19 | import org.workcraft.serialisation.References; |
1508 | @@ -152,9 +154,11 @@ | |||
1509 | 152 | public ModelProperties getProperties(Node node) { | 154 | public ModelProperties getProperties(Node node) { |
1510 | 153 | ModelProperties properties = super.getProperties(node); | 155 | ModelProperties properties = super.getProperties(node); |
1511 | 154 | if (node == null) { | 156 | if (node == null) { |
1512 | 157 | LinkedList<PropertyDescriptor> symbolDescriptors = new LinkedList<>(); | ||
1513 | 155 | for (final Symbol symbol: getSymbols()) { | 158 | for (final Symbol symbol: getSymbols()) { |
1515 | 156 | properties.add(new SymbolPropertyDescriptor(this, symbol)); | 159 | symbolDescriptors.add(new SymbolPropertyDescriptor(this, symbol)); |
1516 | 157 | } | 160 | } |
1517 | 161 | properties.addSorted(symbolDescriptors); | ||
1518 | 158 | } else if (node instanceof Event) { | 162 | } else if (node instanceof Event) { |
1519 | 159 | Event event = (Event) node; | 163 | Event event = (Event) node; |
1520 | 160 | properties.add(new EventSymbolPropertyDescriptor(this, event)); | 164 | properties.add(new EventSymbolPropertyDescriptor(this, event)); |
1521 | 161 | 165 | ||
1522 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/InitialStateSupervisor.java' | |||
1523 | --- FsmPlugin/src/org/workcraft/plugins/fsm/InitialStateSupervisor.java 2015-04-23 12:19:54 +0000 | |||
1524 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/InitialStateSupervisor.java 2015-06-26 22:23:53 +0000 | |||
1525 | @@ -21,7 +21,7 @@ | |||
1526 | 21 | if (e instanceof PropertyChangedEvent) { | 21 | if (e instanceof PropertyChangedEvent) { |
1527 | 22 | PropertyChangedEvent pce = (PropertyChangedEvent)e; | 22 | PropertyChangedEvent pce = (PropertyChangedEvent)e; |
1528 | 23 | Object sender = e.getSender(); | 23 | Object sender = e.getSender(); |
1530 | 24 | if ((sender instanceof State) && pce.getPropertyName().equals("initial")) { | 24 | if ((sender instanceof State) && pce.getPropertyName().equals(State.PROPERTY_INITIAL)) { |
1531 | 25 | // Update all the states on a change of the initial property | 25 | // Update all the states on a change of the initial property |
1532 | 26 | handleInitialStateChange((State)sender); | 26 | handleInitialStateChange((State)sender); |
1533 | 27 | } | 27 | } |
1534 | 28 | 28 | ||
1535 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/State.java' | |||
1536 | --- FsmPlugin/src/org/workcraft/plugins/fsm/State.java 2014-12-13 22:56:43 +0000 | |||
1537 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/State.java 2015-06-26 22:23:53 +0000 | |||
1538 | @@ -8,6 +8,9 @@ | |||
1539 | 8 | @DisplayName("State") | 8 | @DisplayName("State") |
1540 | 9 | @VisualClass(org.workcraft.plugins.fsm.VisualState.class) | 9 | @VisualClass(org.workcraft.plugins.fsm.VisualState.class) |
1541 | 10 | public class State extends MathNode { | 10 | public class State extends MathNode { |
1542 | 11 | public static final String PROPERTY_INITIAL = "Initial"; | ||
1543 | 12 | public static final String PROPERTY_FINAL = "Final"; | ||
1544 | 13 | |||
1545 | 11 | private boolean initialState = false; | 14 | private boolean initialState = false; |
1546 | 12 | private boolean finalState = false; | 15 | private boolean finalState = false; |
1547 | 13 | 16 | ||
1548 | @@ -17,7 +20,7 @@ | |||
1549 | 17 | 20 | ||
1550 | 18 | public void setInitial(boolean value) { | 21 | public void setInitial(boolean value) { |
1551 | 19 | if (setInitialQuiet(value)) { | 22 | if (setInitialQuiet(value)) { |
1553 | 20 | sendNotification(new PropertyChangedEvent(this, "initial")); | 23 | sendNotification(new PropertyChangedEvent(this, PROPERTY_INITIAL)); |
1554 | 21 | } | 24 | } |
1555 | 22 | } | 25 | } |
1556 | 23 | 26 | ||
1557 | @@ -36,7 +39,7 @@ | |||
1558 | 36 | public void setFinal(boolean value) { | 39 | public void setFinal(boolean value) { |
1559 | 37 | if (finalState != value) { | 40 | if (finalState != value) { |
1560 | 38 | finalState = value; | 41 | finalState = value; |
1562 | 39 | sendNotification(new PropertyChangedEvent(this, "final")); | 42 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FINAL)); |
1563 | 40 | } | 43 | } |
1564 | 41 | } | 44 | } |
1565 | 42 | 45 | ||
1566 | 43 | 46 | ||
1567 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/SymbolConsistencySupervisor.java' | |||
1568 | --- FsmPlugin/src/org/workcraft/plugins/fsm/SymbolConsistencySupervisor.java 2015-01-15 18:02:07 +0000 | |||
1569 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/SymbolConsistencySupervisor.java 2015-06-26 22:23:53 +0000 | |||
1570 | @@ -21,7 +21,7 @@ | |||
1571 | 21 | if (e instanceof PropertyChangedEvent) { | 21 | if (e instanceof PropertyChangedEvent) { |
1572 | 22 | PropertyChangedEvent pce = (PropertyChangedEvent)e; | 22 | PropertyChangedEvent pce = (PropertyChangedEvent)e; |
1573 | 23 | Object sender = e.getSender(); | 23 | Object sender = e.getSender(); |
1575 | 24 | if ((sender instanceof Event) && pce.getPropertyName().equals("symbol")) { | 24 | if ((sender instanceof Event) && pce.getPropertyName().equals(Event.PROPERTY_SYMBOL)) { |
1576 | 25 | // Update the collection of symbols on a change of event symbol property | 25 | // Update the collection of symbols on a change of event symbol property |
1577 | 26 | handleEventSymbolChange((Event)sender); | 26 | handleEventSymbolChange((Event)sender); |
1578 | 27 | } | 27 | } |
1579 | 28 | 28 | ||
1580 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/VisualEvent.java' | |||
1581 | --- FsmPlugin/src/org/workcraft/plugins/fsm/VisualEvent.java 2015-04-13 18:41:37 +0000 | |||
1582 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/VisualEvent.java 2015-06-26 22:23:53 +0000 | |||
1583 | @@ -16,10 +16,13 @@ | |||
1584 | 16 | import org.workcraft.gui.Coloriser; | 16 | import org.workcraft.gui.Coloriser; |
1585 | 17 | import org.workcraft.gui.graph.tools.Decoration; | 17 | import org.workcraft.gui.graph.tools.Decoration; |
1586 | 18 | import org.workcraft.gui.propertyeditor.PropertyDeclaration; | 18 | import org.workcraft.gui.propertyeditor.PropertyDeclaration; |
1587 | 19 | import org.workcraft.observation.PropertyChangedEvent; | ||
1588 | 19 | import org.workcraft.plugins.shared.CommonVisualSettings; | 20 | import org.workcraft.plugins.shared.CommonVisualSettings; |
1589 | 20 | import org.workcraft.util.Geometry; | 21 | import org.workcraft.util.Geometry; |
1590 | 21 | 22 | ||
1591 | 22 | public class VisualEvent extends VisualConnection { | 23 | public class VisualEvent extends VisualConnection { |
1592 | 24 | public static final String PROPERTY_LABEL_COLOR = "Label color"; | ||
1593 | 25 | |||
1594 | 23 | // Epsilon symbol in UTF-8 encoding (avoid inserting UTF symbols directly in the source code). | 26 | // Epsilon symbol in UTF-8 encoding (avoid inserting UTF symbols directly in the source code). |
1595 | 24 | public static final char EPSILON_SYMBOL = 0x03B5; | 27 | public static final char EPSILON_SYMBOL = 0x03B5; |
1596 | 25 | 28 | ||
1597 | @@ -43,7 +46,7 @@ | |||
1598 | 43 | 46 | ||
1599 | 44 | private void addPropertyDeclarations() { | 47 | private void addPropertyDeclarations() { |
1600 | 45 | addPropertyDeclaration(new PropertyDeclaration<VisualEvent, Color>( | 48 | addPropertyDeclaration(new PropertyDeclaration<VisualEvent, Color>( |
1602 | 46 | this, "Label color", Color.class) { | 49 | this, PROPERTY_LABEL_COLOR, Color.class) { |
1603 | 47 | protected void setter(VisualEvent object, Color value) { | 50 | protected void setter(VisualEvent object, Color value) { |
1604 | 48 | object.setLabelColor(value); | 51 | object.setLabelColor(value); |
1605 | 49 | } | 52 | } |
1606 | @@ -144,6 +147,7 @@ | |||
1607 | 144 | 147 | ||
1608 | 145 | public void setLabelColor(Color symbolColor) { | 148 | public void setLabelColor(Color symbolColor) { |
1609 | 146 | this.labelColor = symbolColor; | 149 | this.labelColor = symbolColor; |
1610 | 150 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LABEL_COLOR)); | ||
1611 | 147 | } | 151 | } |
1612 | 148 | 152 | ||
1613 | 149 | } | 153 | } |
1614 | 150 | 154 | ||
1615 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/VisualState.java' | |||
1616 | --- FsmPlugin/src/org/workcraft/plugins/fsm/VisualState.java 2015-04-13 18:41:37 +0000 | |||
1617 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/VisualState.java 2015-06-26 22:23:53 +0000 | |||
1618 | @@ -32,7 +32,7 @@ | |||
1619 | 32 | 32 | ||
1620 | 33 | private void addPropertyDeclarations() { | 33 | private void addPropertyDeclarations() { |
1621 | 34 | addPropertyDeclaration(new PropertyDeclaration<VisualState, Boolean>( | 34 | addPropertyDeclaration(new PropertyDeclaration<VisualState, Boolean>( |
1623 | 35 | this, "Initial", Boolean.class, true, false, false) { | 35 | this, State.PROPERTY_INITIAL, Boolean.class, true, false, false) { |
1624 | 36 | public void setter(VisualState object, Boolean value) { | 36 | public void setter(VisualState object, Boolean value) { |
1625 | 37 | object.getReferencedState().setInitial(value); | 37 | object.getReferencedState().setInitial(value); |
1626 | 38 | } | 38 | } |
1627 | @@ -42,7 +42,7 @@ | |||
1628 | 42 | }); | 42 | }); |
1629 | 43 | 43 | ||
1630 | 44 | addPropertyDeclaration(new PropertyDeclaration<VisualState, Boolean>( | 44 | addPropertyDeclaration(new PropertyDeclaration<VisualState, Boolean>( |
1632 | 45 | this, "Final", Boolean.class, true, true, true) { | 45 | this, State.PROPERTY_FINAL, Boolean.class, true, true, true) { |
1633 | 46 | public void setter(VisualState object, Boolean value) { | 46 | public void setter(VisualState object, Boolean value) { |
1634 | 47 | object.getReferencedState().setFinal(value); | 47 | object.getReferencedState().setFinal(value); |
1635 | 48 | } | 48 | } |
1636 | 49 | 49 | ||
1637 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/EventSymbolPropertyDescriptor.java' | |||
1638 | --- FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/EventSymbolPropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
1639 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/EventSymbolPropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
1640 | @@ -25,7 +25,7 @@ | |||
1641 | 25 | 25 | ||
1642 | 26 | @Override | 26 | @Override |
1643 | 27 | public String getName() { | 27 | public String getName() { |
1645 | 28 | return "Symbol"; | 28 | return Event.PROPERTY_SYMBOL; |
1646 | 29 | } | 29 | } |
1647 | 30 | 30 | ||
1648 | 31 | @Override | 31 | @Override |
1649 | 32 | 32 | ||
1650 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/SymbolPropertyDescriptor.java' | |||
1651 | --- FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/SymbolPropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
1652 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/propertydescriptors/SymbolPropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
1653 | @@ -62,7 +62,7 @@ | |||
1654 | 62 | if (node == null) { | 62 | if (node == null) { |
1655 | 63 | fsm.setName(symbol, name); | 63 | fsm.setName(symbol, name); |
1656 | 64 | for (Event event: fsm.getEvents(symbol)) { | 64 | for (Event event: fsm.getEvents(symbol)) { |
1658 | 65 | event.sendNotification(new PropertyChangedEvent(event, "symbol")); | 65 | event.sendNotification(new PropertyChangedEvent(event, Event.PROPERTY_SYMBOL)); |
1659 | 66 | } | 66 | } |
1660 | 67 | } else if (node instanceof Symbol) { | 67 | } else if (node instanceof Symbol) { |
1661 | 68 | } else { | 68 | } else { |
1662 | 69 | 69 | ||
1663 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeadlockCheckerTool.java' | |||
1664 | --- FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeadlockCheckerTool.java 2015-01-26 12:46:03 +0000 | |||
1665 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeadlockCheckerTool.java 2015-06-26 22:23:53 +0000 | |||
1666 | @@ -22,7 +22,7 @@ | |||
1667 | 22 | 22 | ||
1668 | 23 | @Override | 23 | @Override |
1669 | 24 | public String getSection() { | 24 | public String getSection() { |
1671 | 25 | return "Verification"; | 25 | return "!Verification"; |
1672 | 26 | } | 26 | } |
1673 | 27 | 27 | ||
1674 | 28 | @Override | 28 | @Override |
1675 | 29 | 29 | ||
1676 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeterminismCheckerTool.java' | |||
1677 | --- FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeterminismCheckerTool.java 2015-01-26 12:46:03 +0000 | |||
1678 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/tools/DeterminismCheckerTool.java 2015-06-26 22:23:53 +0000 | |||
1679 | @@ -21,7 +21,7 @@ | |||
1680 | 21 | 21 | ||
1681 | 22 | @Override | 22 | @Override |
1682 | 23 | public String getSection() { | 23 | public String getSection() { |
1684 | 24 | return "Verification"; | 24 | return "!Verification"; |
1685 | 25 | } | 25 | } |
1686 | 26 | 26 | ||
1687 | 27 | @Override | 27 | @Override |
1688 | 28 | 28 | ||
1689 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReachabilityCheckerTool.java' | |||
1690 | --- FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReachabilityCheckerTool.java 2015-01-26 12:46:03 +0000 | |||
1691 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReachabilityCheckerTool.java 2015-06-26 22:23:53 +0000 | |||
1692 | @@ -22,7 +22,7 @@ | |||
1693 | 22 | 22 | ||
1694 | 23 | @Override | 23 | @Override |
1695 | 24 | public String getSection() { | 24 | public String getSection() { |
1697 | 25 | return "Verification"; | 25 | return "!Verification"; |
1698 | 26 | } | 26 | } |
1699 | 27 | 27 | ||
1700 | 28 | @Override | 28 | @Override |
1701 | 29 | 29 | ||
1702 | === modified file 'FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReversibilityCheckerTool.java' | |||
1703 | --- FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReversibilityCheckerTool.java 2015-01-26 12:46:03 +0000 | |||
1704 | +++ FsmPlugin/src/org/workcraft/plugins/fsm/tools/ReversibilityCheckerTool.java 2015-06-26 22:23:53 +0000 | |||
1705 | @@ -22,7 +22,7 @@ | |||
1706 | 22 | 22 | ||
1707 | 23 | @Override | 23 | @Override |
1708 | 24 | public String getSection() { | 24 | public String getSection() { |
1710 | 25 | return "Verification"; | 25 | return "!Verification"; |
1711 | 26 | } | 26 | } |
1712 | 27 | 27 | ||
1713 | 28 | @Override | 28 | @Override |
1714 | 29 | 29 | ||
1715 | === modified file 'FstPlugin/src/org/workcraft/plugins/fst/Fst.java' | |||
1716 | --- FstPlugin/src/org/workcraft/plugins/fst/Fst.java 2015-04-13 18:41:37 +0000 | |||
1717 | +++ FstPlugin/src/org/workcraft/plugins/fst/Fst.java 2015-06-26 22:23:53 +0000 | |||
1718 | @@ -1,6 +1,7 @@ | |||
1719 | 1 | package org.workcraft.plugins.fst; | 1 | package org.workcraft.plugins.fst; |
1720 | 2 | 2 | ||
1721 | 3 | import java.util.Collection; | 3 | import java.util.Collection; |
1722 | 4 | import java.util.LinkedList; | ||
1723 | 4 | 5 | ||
1724 | 5 | import org.workcraft.annotations.VisualClass; | 6 | import org.workcraft.annotations.VisualClass; |
1725 | 6 | import org.workcraft.dom.Container; | 7 | import org.workcraft.dom.Container; |
1726 | @@ -8,6 +9,7 @@ | |||
1727 | 8 | import org.workcraft.dom.references.HierarchicalUniqueNameReferenceManager; | 9 | import org.workcraft.dom.references.HierarchicalUniqueNameReferenceManager; |
1728 | 9 | import org.workcraft.exceptions.ArgumentException; | 10 | import org.workcraft.exceptions.ArgumentException; |
1729 | 10 | import org.workcraft.gui.propertyeditor.ModelProperties; | 11 | import org.workcraft.gui.propertyeditor.ModelProperties; |
1730 | 12 | import org.workcraft.gui.propertyeditor.PropertyDescriptor; | ||
1731 | 11 | import org.workcraft.observation.PropertyChangedEvent; | 13 | import org.workcraft.observation.PropertyChangedEvent; |
1732 | 12 | import org.workcraft.observation.StateEvent; | 14 | import org.workcraft.observation.StateEvent; |
1733 | 13 | import org.workcraft.observation.StateSupervisor; | 15 | import org.workcraft.observation.StateSupervisor; |
1734 | @@ -33,9 +35,9 @@ | |||
1735 | 33 | if (e instanceof PropertyChangedEvent) { | 35 | if (e instanceof PropertyChangedEvent) { |
1736 | 34 | PropertyChangedEvent pce = (PropertyChangedEvent)e; | 36 | PropertyChangedEvent pce = (PropertyChangedEvent)e; |
1737 | 35 | Object sender = e.getSender(); | 37 | Object sender = e.getSender(); |
1739 | 36 | if ((sender instanceof Signal) && pce.getPropertyName().equals("type")) { | 38 | if ((sender instanceof Signal) && pce.getPropertyName().equals(Signal.PROPERTY_TYPE)) { |
1740 | 37 | for (Event event: getEvents((Signal)sender)) { | 39 | for (Event event: getEvents((Signal)sender)) { |
1742 | 38 | event.sendNotification(new PropertyChangedEvent(event, "type")); | 40 | event.sendNotification(new PropertyChangedEvent(event, Signal.PROPERTY_TYPE)); |
1743 | 39 | } | 41 | } |
1744 | 40 | } | 42 | } |
1745 | 41 | } | 43 | } |
1746 | @@ -123,19 +125,22 @@ | |||
1747 | 123 | public ModelProperties getProperties(Node node) { | 125 | public ModelProperties getProperties(Node node) { |
1748 | 124 | ModelProperties properties = super.getProperties(node); | 126 | ModelProperties properties = super.getProperties(node); |
1749 | 125 | if (node == null) { | 127 | if (node == null) { |
1750 | 128 | LinkedList<PropertyDescriptor> signalDescriptors= new LinkedList<>(); | ||
1751 | 126 | for (final Signal signal: getSignals()) { | 129 | for (final Signal signal: getSignals()) { |
1753 | 127 | properties.add(new SignalTypePropertyDescriptor(this, signal)); | 130 | signalDescriptors.add(new SignalTypePropertyDescriptor(this, signal)); |
1754 | 128 | } | 131 | } |
1756 | 129 | properties.sortByPropertyName(); | 132 | properties.addSorted(signalDescriptors); |
1757 | 130 | } else if (node instanceof SignalEvent) { | 133 | } else if (node instanceof SignalEvent) { |
1758 | 134 | LinkedList<PropertyDescriptor> eventDescriptors= new LinkedList<>(); | ||
1759 | 131 | SignalEvent signalEvent = (SignalEvent) node; | 135 | SignalEvent signalEvent = (SignalEvent) node; |
1761 | 132 | properties.add(new EventSignalPropertyDescriptor(this, signalEvent)); | 136 | eventDescriptors.add(new EventSignalPropertyDescriptor(this, signalEvent)); |
1762 | 133 | Signal signal = signalEvent.getSignal(); | 137 | Signal signal = signalEvent.getSignal(); |
1764 | 134 | properties.add(new TypePropertyDescriptor(signal)); | 138 | eventDescriptors.add(new TypePropertyDescriptor(signal)); |
1765 | 135 | if (signal.hasDirection()) { | 139 | if (signal.hasDirection()) { |
1767 | 136 | properties.add(new DirectionPropertyDescriptor(signalEvent)); | 140 | eventDescriptors.add(new DirectionPropertyDescriptor(signalEvent)); |
1768 | 137 | } | 141 | } |
1770 | 138 | properties.removeByName("Symbol"); | 142 | properties.addSorted(eventDescriptors); |
1771 | 143 | properties.removeByName(Event.PROPERTY_SYMBOL); | ||
1772 | 139 | } | 144 | } |
1773 | 140 | return properties; | 145 | return properties; |
1774 | 141 | } | 146 | } |
1775 | 142 | 147 | ||
1776 | === modified file 'FstPlugin/src/org/workcraft/plugins/fst/Signal.java' | |||
1777 | --- FstPlugin/src/org/workcraft/plugins/fst/Signal.java 2015-01-12 22:09:40 +0000 | |||
1778 | +++ FstPlugin/src/org/workcraft/plugins/fst/Signal.java 2015-06-26 22:23:53 +0000 | |||
1779 | @@ -6,6 +6,8 @@ | |||
1780 | 6 | 6 | ||
1781 | 7 | public class Signal extends Symbol { | 7 | public class Signal extends Symbol { |
1782 | 8 | 8 | ||
1783 | 9 | public static final String PROPERTY_TYPE = "Type"; | ||
1784 | 10 | |||
1785 | 9 | public enum Type { | 11 | public enum Type { |
1786 | 10 | INPUT("input"), | 12 | INPUT("input"), |
1787 | 11 | OUTPUT("output"), | 13 | OUTPUT("output"), |
1788 | @@ -44,7 +46,7 @@ | |||
1789 | 44 | 46 | ||
1790 | 45 | public void setType(Type type) { | 47 | public void setType(Type type) { |
1791 | 46 | this.type = type; | 48 | this.type = type; |
1793 | 47 | sendNotification(new PropertyChangedEvent(this, "type")); | 49 | sendNotification(new PropertyChangedEvent(this, PROPERTY_TYPE)); |
1794 | 48 | } | 50 | } |
1795 | 49 | 51 | ||
1796 | 50 | public boolean hasDirection() { | 52 | public boolean hasDirection() { |
1797 | 51 | 53 | ||
1798 | === modified file 'FstPlugin/src/org/workcraft/plugins/fst/SignalEvent.java' | |||
1799 | --- FstPlugin/src/org/workcraft/plugins/fst/SignalEvent.java 2015-01-12 22:09:40 +0000 | |||
1800 | +++ FstPlugin/src/org/workcraft/plugins/fst/SignalEvent.java 2015-06-26 22:23:53 +0000 | |||
1801 | @@ -11,6 +11,8 @@ | |||
1802 | 11 | @VisualClass(org.workcraft.plugins.fst.VisualSignalEvent.class) | 11 | @VisualClass(org.workcraft.plugins.fst.VisualSignalEvent.class) |
1803 | 12 | public class SignalEvent extends Event { | 12 | public class SignalEvent extends Event { |
1804 | 13 | 13 | ||
1805 | 14 | public static final String PROPERTY_DIRECTION = "Direction"; | ||
1806 | 15 | |||
1807 | 14 | public enum Direction { | 16 | public enum Direction { |
1808 | 15 | PLUS("+"), | 17 | PLUS("+"), |
1809 | 16 | MINUS("-"), | 18 | MINUS("-"), |
1810 | @@ -52,7 +54,7 @@ | |||
1811 | 52 | 54 | ||
1812 | 53 | public void setDirection(Direction direction) { | 55 | public void setDirection(Direction direction) { |
1813 | 54 | this.direction = direction; | 56 | this.direction = direction; |
1815 | 55 | sendNotification(new PropertyChangedEvent(this, "direction")); | 57 | sendNotification(new PropertyChangedEvent(this, PROPERTY_DIRECTION)); |
1816 | 56 | } | 58 | } |
1817 | 57 | 59 | ||
1818 | 58 | public Signal getSignal() { | 60 | public Signal getSignal() { |
1819 | 59 | 61 | ||
1820 | === modified file 'FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/DirectionPropertyDescriptor.java' | |||
1821 | --- FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/DirectionPropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
1822 | +++ FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/DirectionPropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
1823 | @@ -18,7 +18,7 @@ | |||
1824 | 18 | 18 | ||
1825 | 19 | @Override | 19 | @Override |
1826 | 20 | public String getName() { | 20 | public String getName() { |
1828 | 21 | return "Direction"; | 21 | return SignalEvent.PROPERTY_DIRECTION; |
1829 | 22 | } | 22 | } |
1830 | 23 | 23 | ||
1831 | 24 | @Override | 24 | @Override |
1832 | 25 | 25 | ||
1833 | === modified file 'FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/TypePropertyDescriptor.java' | |||
1834 | --- FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/TypePropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
1835 | +++ FstPlugin/src/org/workcraft/plugins/fst/propertydescriptors/TypePropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
1836 | @@ -9,6 +9,7 @@ | |||
1837 | 9 | import org.workcraft.plugins.fst.Signal.Type; | 9 | import org.workcraft.plugins.fst.Signal.Type; |
1838 | 10 | 10 | ||
1839 | 11 | public class TypePropertyDescriptor implements PropertyDescriptor { | 11 | public class TypePropertyDescriptor implements PropertyDescriptor { |
1840 | 12 | |||
1841 | 12 | private final Signal signal; | 13 | private final Signal signal; |
1842 | 13 | 14 | ||
1843 | 14 | public TypePropertyDescriptor(Signal signal) { | 15 | public TypePropertyDescriptor(Signal signal) { |
1844 | @@ -17,7 +18,7 @@ | |||
1845 | 17 | 18 | ||
1846 | 18 | @Override | 19 | @Override |
1847 | 19 | public String getName() { | 20 | public String getName() { |
1849 | 20 | return "Signal type"; | 21 | return Signal.PROPERTY_TYPE; |
1850 | 21 | } | 22 | } |
1851 | 22 | 23 | ||
1852 | 23 | @Override | 24 | @Override |
1853 | 24 | 25 | ||
1854 | === modified file 'FstPlugin/src/org/workcraft/plugins/fst/tools/FstSimulationTool.java' | |||
1855 | --- FstPlugin/src/org/workcraft/plugins/fst/tools/FstSimulationTool.java 2015-05-27 12:14:35 +0000 | |||
1856 | +++ FstPlugin/src/org/workcraft/plugins/fst/tools/FstSimulationTool.java 2015-06-26 22:23:53 +0000 | |||
1857 | @@ -37,7 +37,7 @@ | |||
1858 | 37 | @Override | 37 | @Override |
1859 | 38 | public void activated(final GraphEditor editor) { | 38 | public void activated(final GraphEditor editor) { |
1860 | 39 | super.activated(editor); | 39 | super.activated(editor); |
1862 | 40 | setStatePaneVisibility(false); | 40 | setStatePaneVisibility(true); |
1863 | 41 | } | 41 | } |
1864 | 42 | 42 | ||
1865 | 43 | @Override | 43 | @Override |
1866 | 44 | 44 | ||
1867 | === modified file 'MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/AbstractMpsatChecker.java' | |||
1868 | --- MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/AbstractMpsatChecker.java 2015-04-23 12:19:54 +0000 | |||
1869 | +++ MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/AbstractMpsatChecker.java 2015-06-26 22:23:53 +0000 | |||
1870 | @@ -11,7 +11,7 @@ | |||
1871 | 11 | 11 | ||
1872 | 12 | @Override | 12 | @Override |
1873 | 13 | public final String getSection() { | 13 | public final String getSection() { |
1875 | 14 | return "Verification"; | 14 | return "!Verification"; |
1876 | 15 | } | 15 | } |
1877 | 16 | 16 | ||
1878 | 17 | @Override | 17 | @Override |
1879 | 18 | 18 | ||
1880 | === modified file 'MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatConformationChecker.java' | |||
1881 | --- MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatConformationChecker.java 2015-04-23 12:19:54 +0000 | |||
1882 | +++ MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatConformationChecker.java 2015-06-26 22:23:53 +0000 | |||
1883 | @@ -16,7 +16,7 @@ | |||
1884 | 16 | 16 | ||
1885 | 17 | @Override | 17 | @Override |
1886 | 18 | public String getSection() { | 18 | public String getSection() { |
1888 | 19 | return "Verification"; | 19 | return "!Verification"; |
1889 | 20 | } | 20 | } |
1890 | 21 | 21 | ||
1891 | 22 | @Override | 22 | @Override |
1892 | 23 | 23 | ||
1893 | === modified file 'MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatCustomPropertyChecker.java' | |||
1894 | --- MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatCustomPropertyChecker.java 2015-04-30 23:14:48 +0000 | |||
1895 | +++ MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatCustomPropertyChecker.java 2015-06-26 22:23:53 +0000 | |||
1896 | @@ -20,7 +20,7 @@ | |||
1897 | 20 | 20 | ||
1898 | 21 | @Override | 21 | @Override |
1899 | 22 | public String getSection() { | 22 | public String getSection() { |
1901 | 23 | return "Verification"; | 23 | return "!Verification"; |
1902 | 24 | } | 24 | } |
1903 | 25 | 25 | ||
1904 | 26 | @Override | 26 | @Override |
1905 | 27 | 27 | ||
1906 | === modified file 'MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatSynthesis.java' | |||
1907 | --- MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatSynthesis.java 2015-04-28 22:14:55 +0000 | |||
1908 | +++ MpsatPlugin/src/org/workcraft/plugins/mpsat/tools/MpsatSynthesis.java 2015-06-26 22:23:53 +0000 | |||
1909 | @@ -20,7 +20,7 @@ | |||
1910 | 20 | 20 | ||
1911 | 21 | @Override | 21 | @Override |
1912 | 22 | public String getSection() { | 22 | public String getSection() { |
1914 | 23 | return "Synthesis"; | 23 | return "!Synthesis"; |
1915 | 24 | } | 24 | } |
1916 | 25 | 25 | ||
1917 | 26 | @Override | 26 | @Override |
1918 | 27 | 27 | ||
1919 | === modified file 'PetriNetPlugin/src/org/workcraft/plugins/petri/Place.java' | |||
1920 | --- PetriNetPlugin/src/org/workcraft/plugins/petri/Place.java 2013-07-25 12:29:40 +0000 | |||
1921 | +++ PetriNetPlugin/src/org/workcraft/plugins/petri/Place.java 2015-06-26 22:23:53 +0000 | |||
1922 | @@ -28,6 +28,9 @@ | |||
1923 | 28 | 28 | ||
1924 | 29 | @VisualClass(org.workcraft.plugins.petri.VisualPlace.class) | 29 | @VisualClass(org.workcraft.plugins.petri.VisualPlace.class) |
1925 | 30 | public class Place extends MathNode { | 30 | public class Place extends MathNode { |
1926 | 31 | public static final String PROPERTY_CAPACITY = "Capacity"; | ||
1927 | 32 | public static final String PROPERTY_TOKENS = "Tokens"; | ||
1928 | 33 | |||
1929 | 31 | protected int tokens = 0; | 34 | protected int tokens = 0; |
1930 | 32 | protected int capacity = 1; | 35 | protected int capacity = 1; |
1931 | 33 | 36 | ||
1932 | @@ -43,7 +46,7 @@ | |||
1933 | 43 | capacity = tokens; | 46 | capacity = tokens; |
1934 | 44 | } | 47 | } |
1935 | 45 | this.tokens = tokens; | 48 | this.tokens = tokens; |
1937 | 46 | sendNotification( new PropertyChangedEvent(this, "tokens") ); | 49 | sendNotification( new PropertyChangedEvent(this, PROPERTY_TOKENS) ); |
1938 | 47 | } | 50 | } |
1939 | 48 | 51 | ||
1940 | 49 | public int getCapacity() { | 52 | public int getCapacity() { |
1941 | @@ -58,6 +61,6 @@ | |||
1942 | 58 | throw new ArgumentException("The place capacity "+ capacity + " is too small for the current number of tokens " + tokens + " ."); | 61 | throw new ArgumentException("The place capacity "+ capacity + " is too small for the current number of tokens " + tokens + " ."); |
1943 | 59 | } | 62 | } |
1944 | 60 | this.capacity = capacity; | 63 | this.capacity = capacity; |
1946 | 61 | sendNotification ( new PropertyChangedEvent (this, "capacity")); | 64 | sendNotification ( new PropertyChangedEvent (this, PROPERTY_CAPACITY)); |
1947 | 62 | } | 65 | } |
1948 | 63 | } | 66 | } |
1949 | 64 | 67 | ||
1950 | === modified file 'PetriNetPlugin/src/org/workcraft/plugins/petri/VisualPlace.java' | |||
1951 | --- PetriNetPlugin/src/org/workcraft/plugins/petri/VisualPlace.java 2014-12-18 16:28:25 +0000 | |||
1952 | +++ PetriNetPlugin/src/org/workcraft/plugins/petri/VisualPlace.java 2015-06-26 22:23:53 +0000 | |||
1953 | @@ -48,6 +48,7 @@ | |||
1954 | 48 | @Hotkey(KeyEvent.VK_P) | 48 | @Hotkey(KeyEvent.VK_P) |
1955 | 49 | @SVGIcon("images/icons/svg/place.svg") | 49 | @SVGIcon("images/icons/svg/place.svg") |
1956 | 50 | public class VisualPlace extends VisualComponent { | 50 | public class VisualPlace extends VisualComponent { |
1957 | 51 | public static final String PROPERTY_TOKEN_COLOR = "Token color"; | ||
1958 | 51 | protected static double singleTokenSize = CommonVisualSettings.getBaseSize() / 1.9; | 52 | protected static double singleTokenSize = CommonVisualSettings.getBaseSize() / 1.9; |
1959 | 52 | protected static double multipleTokenSeparation = CommonVisualSettings.getStrokeWidth() / 8; | 53 | protected static double multipleTokenSeparation = CommonVisualSettings.getStrokeWidth() / 8; |
1960 | 53 | protected Color tokenColor = CommonVisualSettings.getBorderColor(); | 54 | protected Color tokenColor = CommonVisualSettings.getBorderColor(); |
1961 | @@ -59,7 +60,7 @@ | |||
1962 | 59 | 60 | ||
1963 | 60 | private void addPropertyDeclarations() { | 61 | private void addPropertyDeclarations() { |
1964 | 61 | addPropertyDeclaration(new PropertyDeclaration<VisualPlace, Integer>( | 62 | addPropertyDeclaration(new PropertyDeclaration<VisualPlace, Integer>( |
1966 | 62 | this, "Tokens", Integer.class) { | 63 | this, Place.PROPERTY_TOKENS, Integer.class) { |
1967 | 63 | public void setter(VisualPlace object, Integer value) { | 64 | public void setter(VisualPlace object, Integer value) { |
1968 | 64 | object.getReferencedPlace().setTokens(value); | 65 | object.getReferencedPlace().setTokens(value); |
1969 | 65 | } | 66 | } |
1970 | @@ -69,7 +70,7 @@ | |||
1971 | 69 | }); | 70 | }); |
1972 | 70 | 71 | ||
1973 | 71 | addPropertyDeclaration(new PropertyDeclaration<VisualPlace, Color>( | 72 | addPropertyDeclaration(new PropertyDeclaration<VisualPlace, Color>( |
1975 | 72 | this, "Token color", Color.class) { | 73 | this, PROPERTY_TOKEN_COLOR, Color.class) { |
1976 | 73 | public void setter(VisualPlace object, Color value) { | 74 | public void setter(VisualPlace object, Color value) { |
1977 | 74 | object.setTokenColor(value); | 75 | object.setTokenColor(value); |
1978 | 75 | } | 76 | } |
1979 | @@ -79,7 +80,7 @@ | |||
1980 | 79 | }); | 80 | }); |
1981 | 80 | 81 | ||
1982 | 81 | addPropertyDeclaration(new PropertyDeclaration<VisualPlace, Integer>( | 82 | addPropertyDeclaration(new PropertyDeclaration<VisualPlace, Integer>( |
1984 | 82 | this, "Capacity", Integer.class) { | 83 | this, Place.PROPERTY_CAPACITY, Integer.class) { |
1985 | 83 | public void setter(VisualPlace object, Integer value) { | 84 | public void setter(VisualPlace object, Integer value) { |
1986 | 84 | object.getReferencedPlace().setCapacity(value); | 85 | object.getReferencedPlace().setCapacity(value); |
1987 | 85 | } | 86 | } |
1988 | @@ -185,7 +186,7 @@ | |||
1989 | 185 | 186 | ||
1990 | 186 | public void setTokenColor(Color tokenColor) { | 187 | public void setTokenColor(Color tokenColor) { |
1991 | 187 | this.tokenColor = tokenColor; | 188 | this.tokenColor = tokenColor; |
1993 | 188 | sendNotification(new PropertyChangedEvent(this, "token color")); | 189 | sendNotification(new PropertyChangedEvent(this, PROPERTY_TOKEN_COLOR)); |
1994 | 189 | } | 190 | } |
1995 | 190 | 191 | ||
1996 | 191 | @Override | 192 | @Override |
1997 | 192 | 193 | ||
1998 | === modified file 'PetriNetPlugin/src/org/workcraft/plugins/petri/tools/PetriNetSimulationTool.java' | |||
1999 | --- PetriNetPlugin/src/org/workcraft/plugins/petri/tools/PetriNetSimulationTool.java 2015-05-27 12:14:35 +0000 | |||
2000 | +++ PetriNetPlugin/src/org/workcraft/plugins/petri/tools/PetriNetSimulationTool.java 2015-06-26 22:23:53 +0000 | |||
2001 | @@ -67,6 +67,7 @@ | |||
2002 | 67 | import org.workcraft.dom.Container; | 67 | import org.workcraft.dom.Container; |
2003 | 68 | import org.workcraft.dom.Node; | 68 | import org.workcraft.dom.Node; |
2004 | 69 | import org.workcraft.dom.math.MathModel; | 69 | import org.workcraft.dom.math.MathModel; |
2005 | 70 | import org.workcraft.dom.visual.FontHelper; | ||
2006 | 70 | import org.workcraft.dom.visual.HitMan; | 71 | import org.workcraft.dom.visual.HitMan; |
2007 | 71 | import org.workcraft.dom.visual.VisualGroup; | 72 | import org.workcraft.dom.visual.VisualGroup; |
2008 | 72 | import org.workcraft.dom.visual.VisualModel; | 73 | import org.workcraft.dom.visual.VisualModel; |
2009 | @@ -82,6 +83,7 @@ | |||
2010 | 82 | import org.workcraft.gui.graph.tools.Decorator; | 83 | import org.workcraft.gui.graph.tools.Decorator; |
2011 | 83 | import org.workcraft.gui.graph.tools.GraphEditor; | 84 | import org.workcraft.gui.graph.tools.GraphEditor; |
2012 | 84 | import org.workcraft.gui.layouts.WrapLayout; | 85 | import org.workcraft.gui.layouts.WrapLayout; |
2013 | 86 | import org.workcraft.gui.propertyeditor.PropertyEditorTable; | ||
2014 | 85 | import org.workcraft.plugins.petri.PetriNetModel; | 87 | import org.workcraft.plugins.petri.PetriNetModel; |
2015 | 86 | import org.workcraft.plugins.petri.Place; | 88 | import org.workcraft.plugins.petri.Place; |
2016 | 87 | import org.workcraft.plugins.petri.Transition; | 89 | import org.workcraft.plugins.petri.Transition; |
2017 | @@ -177,6 +179,7 @@ | |||
2018 | 177 | 179 | ||
2019 | 178 | traceTable = new JTable(new TraceTableModel()); | 180 | traceTable = new JTable(new TraceTableModel()); |
2020 | 179 | traceTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | 181 | traceTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
2021 | 182 | traceTable.setRowHeight(FontHelper.getFontSizeInPixels(traceTable.getFont())); | ||
2022 | 180 | traceTable.setDefaultRenderer(Object.class, new TraceTableCellRendererImplementation()); | 183 | traceTable.setDefaultRenderer(Object.class, new TraceTableCellRendererImplementation()); |
2023 | 181 | 184 | ||
2024 | 182 | tracePane = new JScrollPane(); | 185 | tracePane = new JScrollPane(); |
2025 | @@ -687,10 +690,10 @@ | |||
2026 | 687 | private final class TraceTableCellRendererImplementation implements TableCellRenderer { | 690 | private final class TraceTableCellRendererImplementation implements TableCellRenderer { |
2027 | 688 | private final JLabel label = new JLabel() { | 691 | private final JLabel label = new JLabel() { |
2028 | 689 | @Override | 692 | @Override |
2033 | 690 | public void paint( Graphics g ) { | 693 | public void paint(Graphics g) { |
2034 | 691 | g.setColor( getBackground() ); | 694 | g.setColor(getBackground()); |
2035 | 692 | g.fillRect( 0, 0, getWidth() - 1, getHeight() - 1 ); | 695 | g.fillRect(0, 0, getWidth() - 1, getHeight() - 1); |
2036 | 693 | super.paint( g ); | 696 | super.paint(g); |
2037 | 694 | } | 697 | } |
2038 | 695 | }; | 698 | }; |
2039 | 696 | 699 | ||
2040 | @@ -700,7 +703,8 @@ | |||
2041 | 700 | return row == mainTrace.getPosition(); | 703 | return row == mainTrace.getPosition(); |
2042 | 701 | } | 704 | } |
2043 | 702 | } else { | 705 | } else { |
2045 | 703 | if (!branchTrace.isEmpty() && (row >= mainTrace.getPosition()) && (row < mainTrace.getPosition() + branchTrace.size())) { | 706 | if (!branchTrace.isEmpty() && (row >= mainTrace.getPosition()) |
2046 | 707 | && (row < mainTrace.getPosition() + branchTrace.size())) { | ||
2047 | 704 | return (row == mainTrace.getPosition() + branchTrace.getPosition()); | 708 | return (row == mainTrace.getPosition() + branchTrace.getPosition()); |
2048 | 705 | } | 709 | } |
2049 | 706 | } | 710 | } |
2050 | @@ -711,13 +715,15 @@ | |||
2051 | 711 | public Component getTableCellRendererComponent(JTable table, Object value, | 715 | public Component getTableCellRendererComponent(JTable table, Object value, |
2052 | 712 | boolean isSelected, boolean hasFocus, int row, int column) { | 716 | boolean isSelected, boolean hasFocus, int row, int column) { |
2053 | 713 | JLabel result = null; | 717 | JLabel result = null; |
2054 | 718 | label.setBorder(PropertyEditorTable.BORDER_RENDER); | ||
2055 | 714 | if ((net != null) && (value instanceof String)) { | 719 | if ((net != null) && (value instanceof String)) { |
2056 | 715 | label.setText((String) value); | 720 | label.setText((String) value); |
2057 | 716 | label.setForeground(Color.BLACK); | ||
2058 | 717 | if (isActive(row, column)) { | 721 | if (isActive(row, column)) { |
2060 | 718 | label.setBackground(Color.YELLOW); | 722 | label.setForeground(table.getSelectionForeground()); |
2061 | 723 | label.setBackground(table.getSelectionBackground()); | ||
2062 | 719 | } else { | 724 | } else { |
2064 | 720 | label.setBackground(Color.WHITE); | 725 | label.setForeground(table.getForeground()); |
2065 | 726 | label.setBackground(table.getBackground()); | ||
2066 | 721 | } | 727 | } |
2067 | 722 | result = label; | 728 | result = label; |
2068 | 723 | } | 729 | } |
2069 | 724 | 730 | ||
2070 | === modified file 'PetrifyPlugin/src/org/workcraft/plugins/petrify/tools/PetrifySynthesis.java' | |||
2071 | --- PetrifyPlugin/src/org/workcraft/plugins/petrify/tools/PetrifySynthesis.java 2015-04-28 22:14:55 +0000 | |||
2072 | +++ PetrifyPlugin/src/org/workcraft/plugins/petrify/tools/PetrifySynthesis.java 2015-06-26 22:23:53 +0000 | |||
2073 | @@ -20,7 +20,7 @@ | |||
2074 | 20 | 20 | ||
2075 | 21 | @Override | 21 | @Override |
2076 | 22 | public String getSection() { | 22 | public String getSection() { |
2078 | 23 | return "Synthesis"; | 23 | return "!Synthesis"; |
2079 | 24 | } | 24 | } |
2080 | 25 | 25 | ||
2081 | 26 | @Override | 26 | @Override |
2082 | @@ -30,7 +30,7 @@ | |||
2083 | 30 | 30 | ||
2084 | 31 | @Override | 31 | @Override |
2085 | 32 | public void run(WorkspaceEntry we) { | 32 | public void run(WorkspaceEntry we) { |
2087 | 33 | // call petrify asynchronous (w/o blocking the GUI) | 33 | // Call Petrify asynchronously (without blocking the GUI) |
2088 | 34 | try { | 34 | try { |
2089 | 35 | File instgFile = getInputSTG(WorkspaceUtils.getAs(we, STGModel.class)); | 35 | File instgFile = getInputSTG(WorkspaceUtils.getAs(we, STGModel.class)); |
2090 | 36 | File eqnFile = File.createTempFile("petrifyEquations", ".eqn"); | 36 | File eqnFile = File.createTempFile("petrifyEquations", ".eqn"); |
2091 | 37 | 37 | ||
2092 | === modified file 'PolicyNetPlugin/src/org/workcraft/plugins/policy/Bundle.java' | |||
2093 | --- PolicyNetPlugin/src/org/workcraft/plugins/policy/Bundle.java 2013-10-31 11:44:01 +0000 | |||
2094 | +++ PolicyNetPlugin/src/org/workcraft/plugins/policy/Bundle.java 2015-06-26 22:23:53 +0000 | |||
2095 | @@ -9,21 +9,26 @@ | |||
2096 | 9 | import org.workcraft.observation.PropertyChangedEvent; | 9 | import org.workcraft.observation.PropertyChangedEvent; |
2097 | 10 | 10 | ||
2098 | 11 | public class Bundle extends MathNode { | 11 | public class Bundle extends MathNode { |
2099 | 12 | public static final String PROPERTY_ADDED = "added"; | ||
2100 | 13 | public static final String PROPERTY_REMOVED = "removed"; | ||
2101 | 14 | public static final String PROPERTY_BUNDLED = "bundled"; | ||
2102 | 15 | public static final String PROPERTY_UNBUNDLED = "unbundled"; | ||
2103 | 16 | |||
2104 | 12 | private final Set<BundledTransition> transitions = new HashSet<BundledTransition>(); | 17 | private final Set<BundledTransition> transitions = new HashSet<BundledTransition>(); |
2105 | 13 | 18 | ||
2106 | 14 | public void add(BundledTransition transition) { | 19 | public void add(BundledTransition transition) { |
2107 | 15 | if (transition != null) { | 20 | if (transition != null) { |
2108 | 16 | transitions.add(transition); | 21 | transitions.add(transition); |
2111 | 17 | sendNotification(new PropertyChangedEvent(this, "added")); | 22 | sendNotification(new PropertyChangedEvent(this, PROPERTY_ADDED)); |
2112 | 18 | transition.sendNotification(new PropertyChangedEvent(this, "bundled")); | 23 | transition.sendNotification(new PropertyChangedEvent(this, PROPERTY_BUNDLED)); |
2113 | 19 | } | 24 | } |
2114 | 20 | } | 25 | } |
2115 | 21 | 26 | ||
2116 | 22 | public void remove(BundledTransition transition) { | 27 | public void remove(BundledTransition transition) { |
2117 | 23 | if (contains(transition)) { | 28 | if (contains(transition)) { |
2118 | 24 | transitions.remove(transition); | 29 | transitions.remove(transition); |
2121 | 25 | sendNotification(new PropertyChangedEvent(this, "removed")); | 30 | sendNotification(new PropertyChangedEvent(this, PROPERTY_REMOVED)); |
2122 | 26 | transition.sendNotification(new PropertyChangedEvent(this, "unbundled")); | 31 | transition.sendNotification(new PropertyChangedEvent(this, PROPERTY_UNBUNDLED)); |
2123 | 27 | } | 32 | } |
2124 | 28 | } | 33 | } |
2125 | 29 | 34 | ||
2126 | 30 | 35 | ||
2127 | === modified file 'PolicyNetPlugin/src/org/workcraft/plugins/policy/VisualBundle.java' | |||
2128 | --- PolicyNetPlugin/src/org/workcraft/plugins/policy/VisualBundle.java 2014-01-28 17:11:19 +0000 | |||
2129 | +++ PolicyNetPlugin/src/org/workcraft/plugins/policy/VisualBundle.java 2015-06-26 22:23:53 +0000 | |||
2130 | @@ -48,6 +48,8 @@ | |||
2131 | 48 | 48 | ||
2132 | 49 | @DisplayName ("Bundle") | 49 | @DisplayName ("Bundle") |
2133 | 50 | public class VisualBundle extends VisualNode implements Drawable, DependentNode { | 50 | public class VisualBundle extends VisualNode implements Drawable, DependentNode { |
2134 | 51 | public static final String PROPERTY_COLOR = "color"; | ||
2135 | 52 | |||
2136 | 51 | private Bundle bundle; | 53 | private Bundle bundle; |
2137 | 52 | protected double strokeWidth = CommonVisualSettings.getStrokeWidth(); | 54 | protected double strokeWidth = CommonVisualSettings.getStrokeWidth(); |
2138 | 53 | private Color color = CieColorUtils.getLabColor(0.7f, (float)Math.random(), (float)Math.random()); | 55 | private Color color = CieColorUtils.getLabColor(0.7f, (float)Math.random(), (float)Math.random()); |
2139 | @@ -142,7 +144,7 @@ | |||
2140 | 142 | 144 | ||
2141 | 143 | public void setColor(Color value) { | 145 | public void setColor(Color value) { |
2142 | 144 | this.color = value; | 146 | this.color = value; |
2144 | 145 | sendNotification(new PropertyChangedEvent(this, "color")); | 147 | sendNotification(new PropertyChangedEvent(this, PROPERTY_COLOR)); |
2145 | 146 | } | 148 | } |
2146 | 147 | 149 | ||
2147 | 148 | public Color getColor() { | 150 | public Color getColor() { |
2148 | 149 | 151 | ||
2149 | === modified file 'PolicyNetPlugin/src/org/workcraft/plugins/policy/tools/CheckDeadlockTool.java' | |||
2150 | --- PolicyNetPlugin/src/org/workcraft/plugins/policy/tools/CheckDeadlockTool.java 2015-04-23 12:19:54 +0000 | |||
2151 | +++ PolicyNetPlugin/src/org/workcraft/plugins/policy/tools/CheckDeadlockTool.java 2015-06-26 22:23:53 +0000 | |||
2152 | @@ -16,7 +16,7 @@ | |||
2153 | 16 | 16 | ||
2154 | 17 | @Override | 17 | @Override |
2155 | 18 | public String getSection() { | 18 | public String getSection() { |
2157 | 19 | return "Verification"; | 19 | return "!Verification"; |
2158 | 20 | } | 20 | } |
2159 | 21 | 21 | ||
2160 | 22 | @Override | 22 | @Override |
2161 | 23 | 23 | ||
2162 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/OutputArea.java' | |||
2163 | --- SONPlugin/src/org/workcraft/plugins/son/gui/OutputArea.java 2014-11-24 18:55:08 +0000 | |||
2164 | +++ SONPlugin/src/org/workcraft/plugins/son/gui/OutputArea.java 2015-06-26 22:23:53 +0000 | |||
2165 | @@ -80,7 +80,7 @@ | |||
2166 | 80 | myfile=new File(myfile.getAbsolutePath().concat(".txt")); | 80 | myfile=new File(myfile.getAbsolutePath().concat(".txt")); |
2167 | 81 | } | 81 | } |
2168 | 82 | } | 82 | } |
2170 | 83 | if(myfile==null || myfile.getName().equals("")) | 83 | if(myfile==null || myfile.getName().isEmpty()) |
2171 | 84 | { | 84 | { |
2172 | 85 | JOptionPane.showMessageDialog(this,"Please enter a file name!","Error",JOptionPane.ERROR_MESSAGE); | 85 | JOptionPane.showMessageDialog(this,"Please enter a file name!","Error",JOptionPane.ERROR_MESSAGE); |
2173 | 86 | return; | 86 | return; |
2174 | 87 | 87 | ||
2175 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/DummyTransition.java' | |||
2176 | --- STGPlugin/src/org/workcraft/plugins/stg/DummyTransition.java 2014-11-07 18:09:40 +0000 | |||
2177 | +++ STGPlugin/src/org/workcraft/plugins/stg/DummyTransition.java 2015-06-26 22:23:53 +0000 | |||
2178 | @@ -29,12 +29,13 @@ | |||
2179 | 29 | @DisplayName("Dummy transition") | 29 | @DisplayName("Dummy transition") |
2180 | 30 | @VisualClass(org.workcraft.plugins.stg.VisualDummyTransition.class) | 30 | @VisualClass(org.workcraft.plugins.stg.VisualDummyTransition.class) |
2181 | 31 | public class DummyTransition extends NamedTransition { | 31 | public class DummyTransition extends NamedTransition { |
2182 | 32 | public static final String PROPERTY_NAME = "Name"; | ||
2183 | 32 | private String name; | 33 | private String name; |
2184 | 33 | 34 | ||
2185 | 34 | @NoAutoSerialisation | 35 | @NoAutoSerialisation |
2186 | 35 | public void setName(String name) { | 36 | public void setName(String name) { |
2187 | 36 | this.name = name; | 37 | this.name = name; |
2189 | 37 | sendNotification(new PropertyChangedEvent(this, "name")); | 38 | sendNotification(new PropertyChangedEvent(this, PROPERTY_NAME)); |
2190 | 38 | } | 39 | } |
2191 | 39 | 40 | ||
2192 | 40 | @NoAutoSerialisation | 41 | @NoAutoSerialisation |
2193 | 41 | 42 | ||
2194 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/SignalTransition.java' | |||
2195 | --- STGPlugin/src/org/workcraft/plugins/stg/SignalTransition.java 2015-01-09 12:41:39 +0000 | |||
2196 | +++ STGPlugin/src/org/workcraft/plugins/stg/SignalTransition.java 2015-06-26 22:23:53 +0000 | |||
2197 | @@ -31,6 +31,10 @@ | |||
2198 | 31 | @VisualClass(org.workcraft.plugins.stg.VisualSignalTransition.class) | 31 | @VisualClass(org.workcraft.plugins.stg.VisualSignalTransition.class) |
2199 | 32 | public class SignalTransition extends NamedTransition | 32 | public class SignalTransition extends NamedTransition |
2200 | 33 | { | 33 | { |
2201 | 34 | public static final String PROPERTY_SIGNAL_TYPE = "Signal type"; | ||
2202 | 35 | public static final String PROPERTY_SIGNAL_NAME = "Signal name"; | ||
2203 | 36 | public static final String PROPERTY_DIRECTION = "Direction"; | ||
2204 | 37 | |||
2205 | 34 | public enum Type { | 38 | public enum Type { |
2206 | 35 | INPUT("input"), | 39 | INPUT("input"), |
2207 | 36 | OUTPUT("output"), | 40 | OUTPUT("output"), |
2208 | @@ -85,7 +89,7 @@ | |||
2209 | 85 | public void setSignalType(Type type) { | 89 | public void setSignalType(Type type) { |
2210 | 86 | if (this.type != type) { | 90 | if (this.type != type) { |
2211 | 87 | this.type = type; | 91 | this.type = type; |
2213 | 88 | sendNotification(new PropertyChangedEvent(this, "signalType")); | 92 | sendNotification(new PropertyChangedEvent(this, PROPERTY_SIGNAL_TYPE)); |
2214 | 89 | } | 93 | } |
2215 | 90 | } | 94 | } |
2216 | 91 | 95 | ||
2217 | @@ -96,7 +100,7 @@ | |||
2218 | 96 | public void setDirection(Direction direction) { | 100 | public void setDirection(Direction direction) { |
2219 | 97 | if (this.direction != direction) { | 101 | if (this.direction != direction) { |
2220 | 98 | this.direction = direction; | 102 | this.direction = direction; |
2222 | 99 | sendNotification(new PropertyChangedEvent(this, "direction")); | 103 | sendNotification(new PropertyChangedEvent(this, PROPERTY_DIRECTION)); |
2223 | 100 | } | 104 | } |
2224 | 101 | } | 105 | } |
2225 | 102 | 106 | ||
2226 | @@ -108,7 +112,7 @@ | |||
2227 | 108 | @NoAutoSerialisation | 112 | @NoAutoSerialisation |
2228 | 109 | public void setSignalName(String signalName) { | 113 | public void setSignalName(String signalName) { |
2229 | 110 | this.signalName = signalName; | 114 | this.signalName = signalName; |
2231 | 111 | sendNotification(new PropertyChangedEvent(this, "signalName")); | 115 | sendNotification(new PropertyChangedEvent(this, PROPERTY_SIGNAL_NAME)); |
2232 | 112 | } | 116 | } |
2233 | 113 | 117 | ||
2234 | 114 | @NoAutoSerialisation | 118 | @NoAutoSerialisation |
2235 | 115 | 119 | ||
2236 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/SignalTypeConsistencySupervisor.java' | |||
2237 | --- STGPlugin/src/org/workcraft/plugins/stg/SignalTypeConsistencySupervisor.java 2015-01-15 18:02:07 +0000 | |||
2238 | +++ STGPlugin/src/org/workcraft/plugins/stg/SignalTypeConsistencySupervisor.java 2015-06-26 22:23:53 +0000 | |||
2239 | @@ -42,18 +42,19 @@ | |||
2240 | 42 | public void handleEvent(StateEvent e) { | 42 | public void handleEvent(StateEvent e) { |
2241 | 43 | if (e instanceof PropertyChangedEvent) { | 43 | if (e instanceof PropertyChangedEvent) { |
2242 | 44 | PropertyChangedEvent pce = (PropertyChangedEvent)e; | 44 | PropertyChangedEvent pce = (PropertyChangedEvent)e; |
2244 | 45 | if (pce.getPropertyName().equals("signalType") || pce.getPropertyName().equals("signalName")) { | 45 | String propertyName = pce.getPropertyName(); |
2245 | 46 | if (propertyName.equals(SignalTransition.PROPERTY_SIGNAL_TYPE) || propertyName.equals(SignalTransition.PROPERTY_SIGNAL_NAME)) { | ||
2246 | 46 | SignalTransition t = (SignalTransition)e.getSender(); | 47 | SignalTransition t = (SignalTransition)e.getSender(); |
2247 | 47 | String signalName = t.getSignalName(); | 48 | String signalName = t.getSignalName(); |
2248 | 48 | Container container = (Container)t.getParent(); | 49 | Container container = (Container)t.getParent(); |
2249 | 49 | SignalTransition.Type signalType = t.getSignalType(); | 50 | SignalTransition.Type signalType = t.getSignalType(); |
2250 | 50 | final Collection<SignalTransition> transitions = stg.getSignalTransitions(signalName, container); | 51 | final Collection<SignalTransition> transitions = stg.getSignalTransitions(signalName, container); |
2252 | 51 | if (pce.getPropertyName().equals("signalType")) { | 52 | if (propertyName.equals(SignalTransition.PROPERTY_SIGNAL_TYPE)) { |
2253 | 52 | for (SignalTransition tt : transitions) { | 53 | for (SignalTransition tt : transitions) { |
2254 | 53 | tt.setSignalType(signalType); | 54 | tt.setSignalType(signalType); |
2255 | 54 | } | 55 | } |
2256 | 55 | } | 56 | } |
2258 | 56 | if (pce.getPropertyName().equals("signalName")) { | 57 | if (propertyName.equals(SignalTransition.PROPERTY_SIGNAL_NAME)) { |
2259 | 57 | for (SignalTransition tt : transitions) { | 58 | for (SignalTransition tt : transitions) { |
2260 | 58 | if (tt == t) continue; | 59 | if (tt == t) continue; |
2261 | 59 | t.setSignalType(tt.getSignalType()); | 60 | t.setSignalType(tt.getSignalType()); |
2262 | 60 | 61 | ||
2263 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/VisualImplicitPlaceArc.java' | |||
2264 | --- STGPlugin/src/org/workcraft/plugins/stg/VisualImplicitPlaceArc.java 2014-12-16 18:20:48 +0000 | |||
2265 | +++ STGPlugin/src/org/workcraft/plugins/stg/VisualImplicitPlaceArc.java 2015-06-26 22:23:53 +0000 | |||
2266 | @@ -78,7 +78,7 @@ | |||
2267 | 78 | 78 | ||
2268 | 79 | private void addPropertyDeclarations() { | 79 | private void addPropertyDeclarations() { |
2269 | 80 | addPropertyDeclaration(new PropertyDeclaration<VisualImplicitPlaceArc, Integer>( | 80 | addPropertyDeclaration(new PropertyDeclaration<VisualImplicitPlaceArc, Integer>( |
2271 | 81 | this, "Tokens", Integer.class) { | 81 | this, Place.PROPERTY_TOKENS, Integer.class) { |
2272 | 82 | public void setter(VisualImplicitPlaceArc object, Integer value) { | 82 | public void setter(VisualImplicitPlaceArc object, Integer value) { |
2273 | 83 | object.getImplicitPlace().setTokens(value); | 83 | object.getImplicitPlace().setTokens(value); |
2274 | 84 | } | 84 | } |
2275 | @@ -88,7 +88,7 @@ | |||
2276 | 88 | }); | 88 | }); |
2277 | 89 | 89 | ||
2278 | 90 | addPropertyDeclaration(new PropertyDeclaration<VisualImplicitPlaceArc, Integer>( | 90 | addPropertyDeclaration(new PropertyDeclaration<VisualImplicitPlaceArc, Integer>( |
2280 | 91 | this, "Capacity", Integer.class) { | 91 | this, Place.PROPERTY_CAPACITY, Integer.class) { |
2281 | 92 | public void setter(VisualImplicitPlaceArc object, Integer value) { | 92 | public void setter(VisualImplicitPlaceArc object, Integer value) { |
2282 | 93 | object.getImplicitPlace().setCapacity(value); | 93 | object.getImplicitPlace().setCapacity(value); |
2283 | 94 | } | 94 | } |
2284 | @@ -98,7 +98,7 @@ | |||
2285 | 98 | }); | 98 | }); |
2286 | 99 | 99 | ||
2287 | 100 | addPropertyDeclaration(new PropertyDeclaration<VisualImplicitPlaceArc, Color>( | 100 | addPropertyDeclaration(new PropertyDeclaration<VisualImplicitPlaceArc, Color>( |
2289 | 101 | this, "Token color", Color.class) { | 101 | this, VisualPlace.PROPERTY_TOKEN_COLOR, Color.class) { |
2290 | 102 | public void setter(VisualImplicitPlaceArc object, Color value) { | 102 | public void setter(VisualImplicitPlaceArc object, Color value) { |
2291 | 103 | object.setTokenColor(value); | 103 | object.setTokenColor(value); |
2292 | 104 | } | 104 | } |
2293 | @@ -182,7 +182,7 @@ | |||
2294 | 182 | 182 | ||
2295 | 183 | public void setTokenColor(Color tokenColor) { | 183 | public void setTokenColor(Color tokenColor) { |
2296 | 184 | this.tokenColor = tokenColor; | 184 | this.tokenColor = tokenColor; |
2298 | 185 | sendNotification(new PropertyChangedEvent(this, "token color")); | 185 | sendNotification(new PropertyChangedEvent(this, VisualPlace.PROPERTY_TOKEN_COLOR)); |
2299 | 186 | } | 186 | } |
2300 | 187 | 187 | ||
2301 | 188 | @Override | 188 | @Override |
2302 | 189 | 189 | ||
2303 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/VisualSTG.java' | |||
2304 | --- STGPlugin/src/org/workcraft/plugins/stg/VisualSTG.java 2015-05-06 21:13:09 +0000 | |||
2305 | +++ STGPlugin/src/org/workcraft/plugins/stg/VisualSTG.java 2015-06-26 22:23:53 +0000 | |||
2306 | @@ -47,6 +47,7 @@ | |||
2307 | 47 | import org.workcraft.exceptions.InvalidConnectionException; | 47 | import org.workcraft.exceptions.InvalidConnectionException; |
2308 | 48 | import org.workcraft.exceptions.NodeCreationException; | 48 | import org.workcraft.exceptions.NodeCreationException; |
2309 | 49 | import org.workcraft.gui.propertyeditor.ModelProperties; | 49 | import org.workcraft.gui.propertyeditor.ModelProperties; |
2310 | 50 | import org.workcraft.gui.propertyeditor.PropertyDescriptor; | ||
2311 | 50 | import org.workcraft.plugins.petri.Place; | 51 | import org.workcraft.plugins.petri.Place; |
2312 | 51 | import org.workcraft.plugins.petri.Transition; | 52 | import org.workcraft.plugins.petri.Transition; |
2313 | 52 | import org.workcraft.plugins.petri.VisualPlace; | 53 | import org.workcraft.plugins.petri.VisualPlace; |
2314 | @@ -335,12 +336,14 @@ | |||
2315 | 335 | ModelProperties properties = super.getProperties(node); | 336 | ModelProperties properties = super.getProperties(node); |
2316 | 336 | if (node == null) { | 337 | if (node == null) { |
2317 | 337 | for (Type type : Type.values()) { | 338 | for (Type type : Type.values()) { |
2318 | 339 | LinkedList<PropertyDescriptor> typeDescriptors = new LinkedList<>(); | ||
2319 | 338 | Container container = NamespaceHelper.getMathContainer(this, getCurrentLevel()); | 340 | Container container = NamespaceHelper.getMathContainer(this, getCurrentLevel()); |
2320 | 339 | for (final String signalName : stg.getSignalNames(type, container)) { | 341 | for (final String signalName : stg.getSignalNames(type, container)) { |
2321 | 340 | if (stg.getSignalTransitions(signalName, container).isEmpty()) continue; | 342 | if (stg.getSignalTransitions(signalName, container).isEmpty()) continue; |
2324 | 341 | properties.add(new SignalNamePropertyDescriptor(stg, signalName, container)); | 343 | typeDescriptors.add(new SignalNamePropertyDescriptor(stg, signalName, container)); |
2325 | 342 | properties.add(new SignalTypePropertyDescriptor(stg, signalName, container)); | 344 | typeDescriptors.add(new SignalTypePropertyDescriptor(stg, signalName, container)); |
2326 | 343 | } | 345 | } |
2327 | 346 | properties.addSorted(typeDescriptors); | ||
2328 | 344 | } | 347 | } |
2329 | 345 | } | 348 | } |
2330 | 346 | return properties; | 349 | return properties; |
2331 | 347 | 350 | ||
2332 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/DirectionPropertyDescriptor.java' | |||
2333 | --- STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/DirectionPropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
2334 | +++ STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/DirectionPropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
2335 | @@ -7,6 +7,7 @@ | |||
2336 | 7 | import org.workcraft.dom.Node; | 7 | import org.workcraft.dom.Node; |
2337 | 8 | import org.workcraft.gui.propertyeditor.PropertyDescriptor; | 8 | import org.workcraft.gui.propertyeditor.PropertyDescriptor; |
2338 | 9 | import org.workcraft.plugins.stg.STG; | 9 | import org.workcraft.plugins.stg.STG; |
2339 | 10 | import org.workcraft.plugins.stg.SignalTransition; | ||
2340 | 10 | import org.workcraft.plugins.stg.SignalTransition.Direction; | 11 | import org.workcraft.plugins.stg.SignalTransition.Direction; |
2341 | 11 | 12 | ||
2342 | 12 | public class DirectionPropertyDescriptor implements PropertyDescriptor { | 13 | public class DirectionPropertyDescriptor implements PropertyDescriptor { |
2343 | @@ -20,7 +21,7 @@ | |||
2344 | 20 | 21 | ||
2345 | 21 | @Override | 22 | @Override |
2346 | 22 | public String getName() { | 23 | public String getName() { |
2348 | 23 | return "Direction"; | 24 | return SignalTransition.PROPERTY_DIRECTION; |
2349 | 24 | } | 25 | } |
2350 | 25 | 26 | ||
2351 | 26 | @Override | 27 | @Override |
2352 | 27 | 28 | ||
2353 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/TypePropertyDescriptor.java' | |||
2354 | --- STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/TypePropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
2355 | +++ STGPlugin/src/org/workcraft/plugins/stg/propertydescriptors/TypePropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
2356 | @@ -10,6 +10,8 @@ | |||
2357 | 10 | import org.workcraft.plugins.stg.SignalTransition.Type; | 10 | import org.workcraft.plugins.stg.SignalTransition.Type; |
2358 | 11 | 11 | ||
2359 | 12 | public class TypePropertyDescriptor implements PropertyDescriptor { | 12 | public class TypePropertyDescriptor implements PropertyDescriptor { |
2360 | 13 | public static final String PROPERTY_SIGNAL_TYPE = "Signal type"; | ||
2361 | 14 | |||
2362 | 13 | private final STG stg; | 15 | private final STG stg; |
2363 | 14 | private final SignalTransition transition; | 16 | private final SignalTransition transition; |
2364 | 15 | 17 | ||
2365 | @@ -20,7 +22,7 @@ | |||
2366 | 20 | 22 | ||
2367 | 21 | @Override | 23 | @Override |
2368 | 22 | public String getName() { | 24 | public String getName() { |
2370 | 23 | return "Signal type"; | 25 | return PROPERTY_SIGNAL_TYPE; |
2371 | 24 | } | 26 | } |
2372 | 25 | 27 | ||
2373 | 26 | @Override | 28 | @Override |
2374 | 27 | 29 | ||
2375 | === modified file 'STGPlugin/src/org/workcraft/plugins/stg/tools/StgSimulationTool.java' | |||
2376 | --- STGPlugin/src/org/workcraft/plugins/stg/tools/StgSimulationTool.java 2015-05-27 12:14:35 +0000 | |||
2377 | +++ STGPlugin/src/org/workcraft/plugins/stg/tools/StgSimulationTool.java 2015-06-26 22:23:53 +0000 | |||
2378 | @@ -18,9 +18,11 @@ | |||
2379 | 18 | import org.workcraft.dom.Connection; | 18 | import org.workcraft.dom.Connection; |
2380 | 19 | import org.workcraft.dom.Node; | 19 | import org.workcraft.dom.Node; |
2381 | 20 | import org.workcraft.dom.hierarchy.NamespaceHelper; | 20 | import org.workcraft.dom.hierarchy.NamespaceHelper; |
2382 | 21 | import org.workcraft.dom.visual.FontHelper; | ||
2383 | 21 | import org.workcraft.dom.visual.connections.VisualConnection; | 22 | import org.workcraft.dom.visual.connections.VisualConnection; |
2384 | 22 | import org.workcraft.gui.Coloriser; | 23 | import org.workcraft.gui.Coloriser; |
2385 | 23 | import org.workcraft.gui.graph.tools.GraphEditor; | 24 | import org.workcraft.gui.graph.tools.GraphEditor; |
2386 | 25 | import org.workcraft.gui.propertyeditor.PropertyEditorTable; | ||
2387 | 24 | import org.workcraft.plugins.petri.Transition; | 26 | import org.workcraft.plugins.petri.Transition; |
2388 | 25 | import org.workcraft.plugins.petri.VisualPlace; | 27 | import org.workcraft.plugins.petri.VisualPlace; |
2389 | 26 | import org.workcraft.plugins.petri.VisualTransition; | 28 | import org.workcraft.plugins.petri.VisualTransition; |
2390 | @@ -73,7 +75,7 @@ | |||
2391 | 73 | } | 75 | } |
2392 | 74 | 76 | ||
2393 | 75 | private final class StateTableCellRendererImplementation implements TableCellRenderer { | 77 | private final class StateTableCellRendererImplementation implements TableCellRenderer { |
2395 | 76 | JLabel label = new JLabel() { | 78 | final JLabel label = new JLabel() { |
2396 | 77 | @Override | 79 | @Override |
2397 | 78 | public void paint(Graphics g) { | 80 | public void paint(Graphics g) { |
2398 | 79 | g.setColor(getBackground()); | 81 | g.setColor(getBackground()); |
2399 | @@ -86,21 +88,25 @@ | |||
2400 | 86 | public Component getTableCellRendererComponent(JTable table, Object value, | 88 | public Component getTableCellRendererComponent(JTable table, Object value, |
2401 | 87 | boolean isSelected, boolean hasFocus, int row, int column) { | 89 | boolean isSelected, boolean hasFocus, int row, int column) { |
2402 | 88 | JLabel result = null; | 90 | JLabel result = null; |
2403 | 91 | label.setBorder(PropertyEditorTable.BORDER_RENDER); | ||
2404 | 92 | label.setBackground(table.getBackground()); | ||
2405 | 89 | if ((net != null) && (value instanceof SignalState)) { | 93 | if ((net != null) && (value instanceof SignalState)) { |
2406 | 90 | SignalState st = (SignalState)value; | 94 | SignalState st = (SignalState)value; |
2407 | 91 | if (column == 0) { | 95 | if (column == 0) { |
2408 | 92 | label.setText(st.name); | 96 | label.setText(st.name); |
2409 | 93 | label.setForeground(st.color); | 97 | label.setForeground(st.color); |
2411 | 94 | label.setFont(label.getFont().deriveFont(Font.PLAIN)); | 98 | Font plainFont = table.getFont().deriveFont(Font.PLAIN); |
2412 | 99 | label.setFont(plainFont); | ||
2413 | 95 | } else { | 100 | } else { |
2414 | 96 | if (st.value < 0) { | 101 | if (st.value < 0) { |
2415 | 97 | label.setText("?"); | 102 | label.setText("?"); |
2416 | 98 | } else { | 103 | } else { |
2417 | 99 | label.setText(Integer.toString(st.value)); | 104 | label.setText(Integer.toString(st.value)); |
2418 | 100 | } | 105 | } |
2420 | 101 | label.setForeground(Color.BLACK); | 106 | label.setForeground(table.getForeground()); |
2421 | 102 | if (st.excited) { | 107 | if (st.excited) { |
2423 | 103 | label.setFont(label.getFont().deriveFont(Font.BOLD)); | 108 | Font boldFont = table.getFont().deriveFont(Font.BOLD); |
2424 | 109 | label.setFont(boldFont); | ||
2425 | 104 | } | 110 | } |
2426 | 105 | } | 111 | } |
2427 | 106 | result = label; | 112 | result = label; |
2428 | @@ -138,18 +144,19 @@ | |||
2429 | 138 | public Component getTableCellRendererComponent(JTable table, Object value, | 144 | public Component getTableCellRendererComponent(JTable table, Object value, |
2430 | 139 | boolean isSelected, boolean hasFocus, int row, int column) { | 145 | boolean isSelected, boolean hasFocus, int row, int column) { |
2431 | 140 | JLabel result = null; | 146 | JLabel result = null; |
2432 | 147 | label.setBorder(PropertyEditorTable.BORDER_RENDER); | ||
2433 | 141 | if ((net != null) && (value instanceof String)) { | 148 | if ((net != null) && (value instanceof String)) { |
2436 | 142 | label.setText((String) value); | 149 | label.setText(value.toString()); |
2437 | 143 | Node node = net.getNodeByReference((String) value); | 150 | Node node = net.getNodeByReference(value.toString()); |
2438 | 144 | if (node instanceof SignalTransition) { | 151 | if (node instanceof SignalTransition) { |
2439 | 145 | SignalTransition st = (SignalTransition)node; | 152 | SignalTransition st = (SignalTransition)node; |
2440 | 146 | Color color = getTypeColor(st.getSignalType()); | 153 | Color color = getTypeColor(st.getSignalType()); |
2441 | 147 | label.setForeground(color); | 154 | label.setForeground(color); |
2442 | 148 | } | 155 | } |
2443 | 149 | if (isActive(row, column)) { | 156 | if (isActive(row, column)) { |
2445 | 150 | label.setBackground(Color.YELLOW); | 157 | label.setBackground(table.getSelectionBackground()); |
2446 | 151 | } else { | 158 | } else { |
2448 | 152 | label.setBackground(Color.WHITE); | 159 | label.setBackground(table.getBackground()); |
2449 | 153 | } | 160 | } |
2450 | 154 | result = label; | 161 | result = label; |
2451 | 155 | } | 162 | } |
2452 | @@ -161,13 +168,11 @@ | |||
2453 | 161 | public void createInterfacePanel(final GraphEditor editor) { | 168 | public void createInterfacePanel(final GraphEditor editor) { |
2454 | 162 | super.createInterfacePanel(editor); | 169 | super.createInterfacePanel(editor); |
2455 | 163 | stateMap = new HashMap<String, SignalState>(); | 170 | stateMap = new HashMap<String, SignalState>(); |
2456 | 164 | |||
2457 | 165 | stateTable = new JTable(new StateTableModel()); | 171 | stateTable = new JTable(new StateTableModel()); |
2458 | 166 | stateTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | 172 | stateTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
2459 | 173 | stateTable.setRowHeight(FontHelper.getFontSizeInPixels(stateTable.getFont())); | ||
2460 | 167 | stateTable.setDefaultRenderer(Object.class, new StateTableCellRendererImplementation()); | 174 | stateTable.setDefaultRenderer(Object.class, new StateTableCellRendererImplementation()); |
2461 | 168 | |||
2462 | 169 | statePane.setViewportView(stateTable); | 175 | statePane.setViewportView(stateTable); |
2463 | 170 | |||
2464 | 171 | traceTable.setDefaultRenderer(Object.class, new TraceTableCellRendererImplementation()); | 176 | traceTable.setDefaultRenderer(Object.class, new TraceTableCellRendererImplementation()); |
2465 | 172 | } | 177 | } |
2466 | 173 | 178 | ||
2467 | @@ -240,8 +245,9 @@ | |||
2468 | 240 | public void activated(final GraphEditor editor) { | 245 | public void activated(final GraphEditor editor) { |
2469 | 241 | super.activated(editor); | 246 | super.activated(editor); |
2470 | 242 | initialiseStateMap(); | 247 | initialiseStateMap(); |
2471 | 248 | setStatePaneVisibility(true); | ||
2472 | 243 | } | 249 | } |
2474 | 244 | 250 | ||
2475 | 245 | public String getTraceLabelByReference(String ref) { | 251 | public String getTraceLabelByReference(String ref) { |
2476 | 246 | String result = null; | 252 | String result = null; |
2477 | 247 | if (ref != null) { | 253 | if (ref != null) { |
2478 | 248 | 254 | ||
2479 | === modified file 'WorkcraftCore/src/org/workcraft/dom/hierarchy/NamespaceHelper.java' | |||
2480 | --- WorkcraftCore/src/org/workcraft/dom/hierarchy/NamespaceHelper.java 2015-05-14 18:00:15 +0000 | |||
2481 | +++ WorkcraftCore/src/org/workcraft/dom/hierarchy/NamespaceHelper.java 2015-06-26 22:23:53 +0000 | |||
2482 | @@ -45,7 +45,7 @@ | |||
2483 | 45 | 45 | ||
2484 | 46 | String head = getReferenceHead(reference); | 46 | String head = getReferenceHead(reference); |
2485 | 47 | String tail = getReferenceTail(reference); | 47 | String tail = getReferenceTail(reference); |
2487 | 48 | if (tail.equals("")) { | 48 | if (tail.isEmpty()) { |
2488 | 49 | return ret+head; | 49 | return ret+head; |
2489 | 50 | } | 50 | } |
2490 | 51 | return ret + head + hierarchicalToFlatName(tail, flatSeparator, false); | 51 | return ret + head + hierarchicalToFlatName(tail, flatSeparator, false); |
2491 | @@ -63,7 +63,7 @@ | |||
2492 | 63 | } | 63 | } |
2493 | 64 | 64 | ||
2494 | 65 | public static void splitReference(String reference, LinkedList<String> path) { | 65 | public static void splitReference(String reference, LinkedList<String> path) { |
2496 | 66 | if (reference.equals("")) return; | 66 | if (reference.isEmpty()) return; |
2497 | 67 | 67 | ||
2498 | 68 | Matcher matcher = hPattern.matcher(reference); | 68 | Matcher matcher = hPattern.matcher(reference); |
2499 | 69 | if (matcher.find()) { | 69 | if (matcher.find()) { |
2500 | @@ -127,7 +127,7 @@ | |||
2501 | 127 | public static String getReferenceName(String reference) { | 127 | public static String getReferenceName(String reference) { |
2502 | 128 | String head = getReferenceHead(reference); | 128 | String head = getReferenceHead(reference); |
2503 | 129 | String tail = getReferenceTail(reference); | 129 | String tail = getReferenceTail(reference); |
2505 | 130 | if (tail.equals("")) { | 130 | if (tail.isEmpty()) { |
2506 | 131 | return head; | 131 | return head; |
2507 | 132 | } | 132 | } |
2508 | 133 | return getReferenceName(tail); | 133 | return getReferenceName(tail); |
2509 | 134 | 134 | ||
2510 | === modified file 'WorkcraftCore/src/org/workcraft/dom/references/HierarchicalUniqueNameReferenceManager.java' | |||
2511 | --- WorkcraftCore/src/org/workcraft/dom/references/HierarchicalUniqueNameReferenceManager.java 2015-05-14 18:00:15 +0000 | |||
2512 | +++ WorkcraftCore/src/org/workcraft/dom/references/HierarchicalUniqueNameReferenceManager.java 2015-06-26 22:23:53 +0000 | |||
2513 | @@ -136,7 +136,7 @@ | |||
2514 | 136 | if (provider==null) { | 136 | if (provider==null) { |
2515 | 137 | provider = topProvider; | 137 | provider = topProvider; |
2516 | 138 | } | 138 | } |
2518 | 139 | if (reference.equals("") || reference.equals(NamespaceHelper.hierarchySeparator)) { | 139 | if (reference.isEmpty() || reference.equals(NamespaceHelper.hierarchySeparator)) { |
2519 | 140 | return provider; | 140 | return provider; |
2520 | 141 | } | 141 | } |
2521 | 142 | String head = NamespaceHelper.getReferenceHead(reference); | 142 | String head = NamespaceHelper.getReferenceHead(reference); |
2522 | @@ -163,7 +163,7 @@ | |||
2523 | 163 | do { | 163 | do { |
2524 | 164 | component = getNamespaceProvider(node); | 164 | component = getNamespaceProvider(node); |
2525 | 165 | if (component != null) { | 165 | if (component != null) { |
2527 | 166 | if (!result.equals("")) { | 166 | if (!result.isEmpty()) { |
2528 | 167 | result = NamespaceHelper.hierarchySeparator + result; | 167 | result = NamespaceHelper.hierarchySeparator + result; |
2529 | 168 | } | 168 | } |
2530 | 169 | String name = getNameManager(component).getName(node); | 169 | String name = getNameManager(component).getName(node); |
2531 | 170 | 170 | ||
2532 | === added file 'WorkcraftCore/src/org/workcraft/dom/visual/FontHelper.java' | |||
2533 | --- WorkcraftCore/src/org/workcraft/dom/visual/FontHelper.java 1970-01-01 00:00:00 +0000 | |||
2534 | +++ WorkcraftCore/src/org/workcraft/dom/visual/FontHelper.java 2015-06-26 22:23:53 +0000 | |||
2535 | @@ -0,0 +1,13 @@ | |||
2536 | 1 | package org.workcraft.dom.visual; | ||
2537 | 2 | |||
2538 | 3 | import java.awt.Font; | ||
2539 | 4 | import java.awt.Toolkit; | ||
2540 | 5 | |||
2541 | 6 | public class FontHelper { | ||
2542 | 7 | |||
2543 | 8 | public static int getFontSizeInPixels(Font font) { | ||
2544 | 9 | int screenDpi = Toolkit.getDefaultToolkit().getScreenResolution(); | ||
2545 | 10 | return (int)Math.round(font.getSize2D() * screenDpi / 72.0); | ||
2546 | 11 | } | ||
2547 | 12 | |||
2548 | 13 | } | ||
2549 | 0 | 14 | ||
2550 | === modified file 'WorkcraftCore/src/org/workcraft/dom/visual/VisualComponent.java' | |||
2551 | --- WorkcraftCore/src/org/workcraft/dom/visual/VisualComponent.java 2015-02-27 18:31:36 +0000 | |||
2552 | +++ WorkcraftCore/src/org/workcraft/dom/visual/VisualComponent.java 2015-06-26 22:23:53 +0000 | |||
2553 | @@ -43,6 +43,14 @@ | |||
2554 | 43 | import org.workcraft.plugins.shared.CommonVisualSettings; | 43 | import org.workcraft.plugins.shared.CommonVisualSettings; |
2555 | 44 | 44 | ||
2556 | 45 | public abstract class VisualComponent extends VisualTransformableNode implements Drawable, DependentNode { | 45 | public abstract class VisualComponent extends VisualTransformableNode implements Drawable, DependentNode { |
2557 | 46 | public static final String PROPERTY_LABEL = "Label"; | ||
2558 | 47 | public static final String PROPERTY_LABEL_POSITIONING = "Label positioning"; | ||
2559 | 48 | public static final String PROPERTY_LABEL_COLOR = "Label color"; | ||
2560 | 49 | public static final String PROPERTY_NAME_POSITIONING = "Name positioning"; | ||
2561 | 50 | public static final String PROPERTY_NAME_COLOR = "Name color"; | ||
2562 | 51 | public static final String PROPERTY_FOREGROUND_COLOR = "Foreground color"; | ||
2563 | 52 | public static final String PROPERTY_FILL_COLOR = "Fill color"; | ||
2564 | 53 | |||
2565 | 46 | public static final Font labelFont = new Font("Sans-serif", Font.PLAIN, 1).deriveFont(0.5f); | 54 | public static final Font labelFont = new Font("Sans-serif", Font.PLAIN, 1).deriveFont(0.5f); |
2566 | 47 | public static final Font nameFont = new Font("Sans-serif", Font.ITALIC, 1).deriveFont(0.5f); | 55 | public static final Font nameFont = new Font("Sans-serif", Font.ITALIC, 1).deriveFont(0.5f); |
2567 | 48 | 56 | ||
2568 | @@ -90,7 +98,7 @@ | |||
2569 | 90 | 98 | ||
2570 | 91 | private void addColorPropertyDeclarations() { | 99 | private void addColorPropertyDeclarations() { |
2571 | 92 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( | 100 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( |
2573 | 93 | this, "Foreground color", Color.class) { | 101 | this, PROPERTY_FOREGROUND_COLOR, Color.class) { |
2574 | 94 | protected void setter(VisualComponent object, Color value) { | 102 | protected void setter(VisualComponent object, Color value) { |
2575 | 95 | object.setForegroundColor(value); | 103 | object.setForegroundColor(value); |
2576 | 96 | } | 104 | } |
2577 | @@ -100,7 +108,7 @@ | |||
2578 | 100 | }); | 108 | }); |
2579 | 101 | 109 | ||
2580 | 102 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( | 110 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( |
2582 | 103 | this, "Fill color", Color.class) { | 111 | this, PROPERTY_FILL_COLOR, Color.class) { |
2583 | 104 | protected void setter(VisualComponent object, Color value) { | 112 | protected void setter(VisualComponent object, Color value) { |
2584 | 105 | object.setFillColor(value); | 113 | object.setFillColor(value); |
2585 | 106 | } | 114 | } |
2586 | @@ -112,7 +120,7 @@ | |||
2587 | 112 | 120 | ||
2588 | 113 | private void addLabelPropertyDeclarations() { | 121 | private void addLabelPropertyDeclarations() { |
2589 | 114 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, String>( | 122 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, String>( |
2591 | 115 | this, "Label", String.class) { | 123 | this, PROPERTY_LABEL, String.class) { |
2592 | 116 | protected void setter(VisualComponent object, String value) { | 124 | protected void setter(VisualComponent object, String value) { |
2593 | 117 | object.setLabel(value); | 125 | object.setLabel(value); |
2594 | 118 | } | 126 | } |
2595 | @@ -122,7 +130,7 @@ | |||
2596 | 122 | }); | 130 | }); |
2597 | 123 | 131 | ||
2598 | 124 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Positioning>( | 132 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Positioning>( |
2600 | 125 | this, "Label positioning", Positioning.class) { | 133 | this, PROPERTY_LABEL_POSITIONING, Positioning.class) { |
2601 | 126 | protected void setter(VisualComponent object, Positioning value) { | 134 | protected void setter(VisualComponent object, Positioning value) { |
2602 | 127 | object.setLabelPositioning(value); | 135 | object.setLabelPositioning(value); |
2603 | 128 | } | 136 | } |
2604 | @@ -132,7 +140,7 @@ | |||
2605 | 132 | }); | 140 | }); |
2606 | 133 | 141 | ||
2607 | 134 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( | 142 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( |
2609 | 135 | this, "Label color", Color.class) { | 143 | this, PROPERTY_LABEL_COLOR, Color.class) { |
2610 | 136 | protected void setter(VisualComponent object, Color value) { | 144 | protected void setter(VisualComponent object, Color value) { |
2611 | 137 | object.setLabelColor(value); | 145 | object.setLabelColor(value); |
2612 | 138 | } | 146 | } |
2613 | @@ -144,7 +152,7 @@ | |||
2614 | 144 | 152 | ||
2615 | 145 | private void addNamePropertyDeclarations() { | 153 | private void addNamePropertyDeclarations() { |
2616 | 146 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Positioning>( | 154 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Positioning>( |
2618 | 147 | this, "Name positioning", Positioning.class) { | 155 | this, PROPERTY_NAME_POSITIONING, Positioning.class) { |
2619 | 148 | protected void setter(VisualComponent object, Positioning value) { | 156 | protected void setter(VisualComponent object, Positioning value) { |
2620 | 149 | object.setNamePositioning(value); | 157 | object.setNamePositioning(value); |
2621 | 150 | } | 158 | } |
2622 | @@ -154,7 +162,7 @@ | |||
2623 | 154 | }); | 162 | }); |
2624 | 155 | 163 | ||
2625 | 156 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( | 164 | addPropertyDeclaration(new PropertyDeclaration<VisualComponent, Color>( |
2627 | 157 | this, "Name color", Color.class) { | 165 | this, PROPERTY_NAME_COLOR, Color.class) { |
2628 | 158 | protected void setter(VisualComponent object, Color value) { | 166 | protected void setter(VisualComponent object, Color value) { |
2629 | 159 | object.setNameColor(value); | 167 | object.setNameColor(value); |
2630 | 160 | } | 168 | } |
2631 | @@ -170,7 +178,7 @@ | |||
2632 | 170 | 178 | ||
2633 | 171 | public void setLabel(String label) { | 179 | public void setLabel(String label) { |
2634 | 172 | this.label = label; | 180 | this.label = label; |
2636 | 173 | sendNotification(new PropertyChangedEvent(this, "label")); | 181 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LABEL)); |
2637 | 174 | } | 182 | } |
2638 | 175 | 183 | ||
2639 | 176 | public Positioning getLabelPositioning() { | 184 | public Positioning getLabelPositioning() { |
2640 | @@ -179,7 +187,7 @@ | |||
2641 | 179 | 187 | ||
2642 | 180 | public void setLabelPositioning(Positioning value) { | 188 | public void setLabelPositioning(Positioning value) { |
2643 | 181 | labelPositioning = value; | 189 | labelPositioning = value; |
2645 | 182 | sendNotification(new PropertyChangedEvent(this, "label positioning")); | 190 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LABEL_POSITIONING)); |
2646 | 183 | } | 191 | } |
2647 | 184 | 192 | ||
2648 | 185 | public Color getLabelColor() { | 193 | public Color getLabelColor() { |
2649 | @@ -188,7 +196,7 @@ | |||
2650 | 188 | 196 | ||
2651 | 189 | public void setLabelColor(Color value) { | 197 | public void setLabelColor(Color value) { |
2652 | 190 | labelColor = value; | 198 | labelColor = value; |
2654 | 191 | sendNotification(new PropertyChangedEvent(this, "label color")); | 199 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LABEL_COLOR)); |
2655 | 192 | } | 200 | } |
2656 | 193 | 201 | ||
2657 | 194 | public Positioning getNamePositioning() { | 202 | public Positioning getNamePositioning() { |
2658 | @@ -197,7 +205,7 @@ | |||
2659 | 197 | 205 | ||
2660 | 198 | public void setNamePositioning(Positioning value) { | 206 | public void setNamePositioning(Positioning value) { |
2661 | 199 | namePositioning = value; | 207 | namePositioning = value; |
2663 | 200 | sendNotification(new PropertyChangedEvent(this, "reference positioning")); | 208 | sendNotification(new PropertyChangedEvent(this, PROPERTY_NAME_POSITIONING)); |
2664 | 201 | } | 209 | } |
2665 | 202 | 210 | ||
2666 | 203 | public Color getNameColor() { | 211 | public Color getNameColor() { |
2667 | @@ -206,7 +214,7 @@ | |||
2668 | 206 | 214 | ||
2669 | 207 | public void setNameColor(Color value) { | 215 | public void setNameColor(Color value) { |
2670 | 208 | nameColor = value; | 216 | nameColor = value; |
2672 | 209 | sendNotification(new PropertyChangedEvent(this, "reference color")); | 217 | sendNotification(new PropertyChangedEvent(this, PROPERTY_NAME_COLOR)); |
2673 | 210 | } | 218 | } |
2674 | 211 | 219 | ||
2675 | 212 | public Color getForegroundColor() { | 220 | public Color getForegroundColor() { |
2676 | @@ -215,7 +223,7 @@ | |||
2677 | 215 | 223 | ||
2678 | 216 | public void setForegroundColor(Color value) { | 224 | public void setForegroundColor(Color value) { |
2679 | 217 | foregroundColor = value; | 225 | foregroundColor = value; |
2681 | 218 | sendNotification(new PropertyChangedEvent(this, "foreground color")); | 226 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FOREGROUND_COLOR)); |
2682 | 219 | } | 227 | } |
2683 | 220 | 228 | ||
2684 | 221 | public Color getFillColor() { | 229 | public Color getFillColor() { |
2685 | @@ -224,7 +232,7 @@ | |||
2686 | 224 | 232 | ||
2687 | 225 | public void setFillColor(Color value) { | 233 | public void setFillColor(Color value) { |
2688 | 226 | fillColor = value; | 234 | fillColor = value; |
2690 | 227 | sendNotification(new PropertyChangedEvent(this, "fill color")); | 235 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FILL_COLOR)); |
2691 | 228 | } | 236 | } |
2692 | 229 | 237 | ||
2693 | 230 | public MathNode getReferencedComponent() { | 238 | public MathNode getReferencedComponent() { |
2694 | 231 | 239 | ||
2695 | === modified file 'WorkcraftCore/src/org/workcraft/dom/visual/VisualGroup.java' | |||
2696 | --- WorkcraftCore/src/org/workcraft/dom/visual/VisualGroup.java 2015-06-03 16:22:58 +0000 | |||
2697 | +++ WorkcraftCore/src/org/workcraft/dom/visual/VisualGroup.java 2015-06-26 22:23:53 +0000 | |||
2698 | @@ -48,9 +48,7 @@ | |||
2699 | 48 | 48 | ||
2700 | 49 | 49 | ||
2701 | 50 | public class VisualGroup extends VisualTransformableNode implements Drawable, Collapsible, Container, ObservableHierarchy { | 50 | public class VisualGroup extends VisualTransformableNode implements Drawable, Collapsible, Container, ObservableHierarchy { |
2705 | 51 | public static final int HIT_COMPONENT = 1; | 51 | public static final String PROPERTY_IS_COLLAPSED = "Is collapsed"; |
2703 | 52 | public static final int HIT_CONNECTION = 2; | ||
2704 | 53 | public static final int HIT_GROUP = 3; | ||
2706 | 54 | 52 | ||
2707 | 55 | protected double size = CommonVisualSettings.getBaseSize(); | 53 | protected double size = CommonVisualSettings.getBaseSize(); |
2708 | 56 | protected final double margin = 0.20; | 54 | protected final double margin = 0.20; |
2709 | @@ -67,7 +65,7 @@ | |||
2710 | 67 | 65 | ||
2711 | 68 | private void addPropertyDeclarations() { | 66 | private void addPropertyDeclarations() { |
2712 | 69 | addPropertyDeclaration(new PropertyDeclaration<VisualGroup, Boolean>( | 67 | addPropertyDeclaration(new PropertyDeclaration<VisualGroup, Boolean>( |
2714 | 70 | this, "Is collapsed", Boolean.class) { | 68 | this, PROPERTY_IS_COLLAPSED, Boolean.class) { |
2715 | 71 | 69 | ||
2716 | 72 | @Override | 70 | @Override |
2717 | 73 | protected void setter(VisualGroup object, Boolean value) { | 71 | protected void setter(VisualGroup object, Boolean value) { |
2718 | 74 | 72 | ||
2719 | === modified file 'WorkcraftCore/src/org/workcraft/dom/visual/VisualPage.java' | |||
2720 | --- WorkcraftCore/src/org/workcraft/dom/visual/VisualPage.java 2015-05-22 17:42:39 +0000 | |||
2721 | +++ WorkcraftCore/src/org/workcraft/dom/visual/VisualPage.java 2015-06-26 22:23:53 +0000 | |||
2722 | @@ -30,6 +30,9 @@ | |||
2723 | 30 | @DisplayName("Page") | 30 | @DisplayName("Page") |
2724 | 31 | @SVGIcon("images/icons/svg/selection-page.svg") | 31 | @SVGIcon("images/icons/svg/selection-page.svg") |
2725 | 32 | public class VisualPage extends VisualComponent implements Drawable, Collapsible, Container, ObservableHierarchy { | 32 | public class VisualPage extends VisualComponent implements Drawable, Collapsible, Container, ObservableHierarchy { |
2726 | 33 | public static final String PROPERTY_IS_COLLAPSED = "Is collapsed"; | ||
2727 | 34 | public static final String PROPERTY_REFERENCED_MODEL = "Referenced model"; | ||
2728 | 35 | |||
2729 | 33 | private boolean isCurrentLevelInside = false; | 36 | private boolean isCurrentLevelInside = false; |
2730 | 34 | private boolean isCollapsed = false; | 37 | private boolean isCollapsed = false; |
2731 | 35 | private boolean isExcited = false; | 38 | private boolean isExcited = false; |
2732 | @@ -56,7 +59,7 @@ | |||
2733 | 56 | 59 | ||
2734 | 57 | private void addPropertyDeclarations() { | 60 | private void addPropertyDeclarations() { |
2735 | 58 | addPropertyDeclaration(new PropertyDeclaration<VisualPage, Boolean>( | 61 | addPropertyDeclaration(new PropertyDeclaration<VisualPage, Boolean>( |
2737 | 59 | this, "Is collapsed", Boolean.class) { | 62 | this, PROPERTY_IS_COLLAPSED, Boolean.class) { |
2738 | 60 | 63 | ||
2739 | 61 | @Override | 64 | @Override |
2740 | 62 | protected void setter(VisualPage object, Boolean value) { | 65 | protected void setter(VisualPage object, Boolean value) { |
2741 | @@ -69,7 +72,7 @@ | |||
2742 | 69 | }); | 72 | }); |
2743 | 70 | 73 | ||
2744 | 71 | addPropertyDeclaration(new PropertyDeclaration<VisualPage, String>( | 74 | addPropertyDeclaration(new PropertyDeclaration<VisualPage, String>( |
2746 | 72 | this, "Referenced model", String.class) { | 75 | this, PROPERTY_REFERENCED_MODEL, String.class) { |
2747 | 73 | 76 | ||
2748 | 74 | @Override | 77 | @Override |
2749 | 75 | protected void setter(VisualPage object, String value) { | 78 | protected void setter(VisualPage object, String value) { |
2750 | 76 | 79 | ||
2751 | === modified file 'WorkcraftCore/src/org/workcraft/dom/visual/connections/VisualConnection.java' | |||
2752 | --- WorkcraftCore/src/org/workcraft/dom/visual/connections/VisualConnection.java 2015-04-13 18:41:37 +0000 | |||
2753 | +++ WorkcraftCore/src/org/workcraft/dom/visual/connections/VisualConnection.java 2015-06-26 22:23:53 +0000 | |||
2754 | @@ -61,6 +61,13 @@ | |||
2755 | 61 | public class VisualConnection extends VisualNode implements Node, Drawable, Shapable, DependentNode, | 61 | public class VisualConnection extends VisualNode implements Node, Drawable, Shapable, DependentNode, |
2756 | 62 | Connection, VisualConnectionProperties, ObservableHierarchy { | 62 | Connection, VisualConnectionProperties, ObservableHierarchy { |
2757 | 63 | 63 | ||
2758 | 64 | public static final String PROPERTY_CONNECTION_TYPE = "Connection type"; | ||
2759 | 65 | public static final String PROPERTY_COLOR = "Color"; | ||
2760 | 66 | public static final String PROPERTY_LINE_WIDTH = "Line width"; | ||
2761 | 67 | public static final String PROPERTY_ARROW_LENGTH = "Arrow length"; | ||
2762 | 68 | public static final String PROPERTY_ARROW_WIDTH = "Arrow width"; | ||
2763 | 69 | public static final String PROPERTY_SCALE_MODE = "Scale mode"; | ||
2764 | 70 | |||
2765 | 64 | public enum ConnectionType { | 71 | public enum ConnectionType { |
2766 | 65 | POLYLINE("Polyline"), | 72 | POLYLINE("Polyline"), |
2767 | 66 | BEZIER("Bezier"); | 73 | BEZIER("Bezier"); |
2768 | @@ -151,7 +158,7 @@ | |||
2769 | 151 | 158 | ||
2770 | 152 | private void addPropertyDeclarations() { | 159 | private void addPropertyDeclarations() { |
2771 | 153 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Double>( | 160 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Double>( |
2773 | 154 | this, "Line width", Double.class, true, true, true) { | 161 | this, PROPERTY_LINE_WIDTH, Double.class, true, true, true) { |
2774 | 155 | @Override | 162 | @Override |
2775 | 156 | public void setter(VisualConnection object, Double value) { | 163 | public void setter(VisualConnection object, Double value) { |
2776 | 157 | object.setLineWidth(value); | 164 | object.setLineWidth(value); |
2777 | @@ -163,7 +170,7 @@ | |||
2778 | 163 | }); | 170 | }); |
2779 | 164 | 171 | ||
2780 | 165 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Double>( | 172 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Double>( |
2782 | 166 | this, "Arrow width", Double.class, true, true, true) { | 173 | this, PROPERTY_ARROW_WIDTH, Double.class, true, true, true) { |
2783 | 167 | @Override | 174 | @Override |
2784 | 168 | public void setter(VisualConnection object, Double value) { | 175 | public void setter(VisualConnection object, Double value) { |
2785 | 169 | object.setArrowWidth(value); | 176 | object.setArrowWidth(value); |
2786 | @@ -175,7 +182,7 @@ | |||
2787 | 175 | }); | 182 | }); |
2788 | 176 | 183 | ||
2789 | 177 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Double>( | 184 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Double>( |
2791 | 178 | this, "Arrow length", Double.class, true, true, true) { | 185 | this, PROPERTY_ARROW_LENGTH, Double.class, true, true, true) { |
2792 | 179 | @Override | 186 | @Override |
2793 | 180 | public void setter(VisualConnection object, Double value) { | 187 | public void setter(VisualConnection object, Double value) { |
2794 | 181 | object.setArrowLength(value); | 188 | object.setArrowLength(value); |
2795 | @@ -196,7 +203,7 @@ | |||
2796 | 196 | }); | 203 | }); |
2797 | 197 | 204 | ||
2798 | 198 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, ConnectionType>( | 205 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, ConnectionType>( |
2800 | 199 | this, "Connection type", ConnectionType.class, true, true, false) { | 206 | this, PROPERTY_CONNECTION_TYPE, ConnectionType.class, true, true, false) { |
2801 | 200 | protected void setter(VisualConnection object, ConnectionType value) { | 207 | protected void setter(VisualConnection object, ConnectionType value) { |
2802 | 201 | object.setConnectionType(value); | 208 | object.setConnectionType(value); |
2803 | 202 | for (ControlPoint cp: object.getGraphic().getControlPoints()) { | 209 | for (ControlPoint cp: object.getGraphic().getControlPoints()) { |
2804 | @@ -211,7 +218,7 @@ | |||
2805 | 211 | }); | 218 | }); |
2806 | 212 | 219 | ||
2807 | 213 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, ScaleMode>( | 220 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, ScaleMode>( |
2809 | 214 | this, "Scale mode", ScaleMode.class, true, true, true) { | 221 | this, PROPERTY_SCALE_MODE, ScaleMode.class, true, true, true) { |
2810 | 215 | protected void setter(VisualConnection object, ScaleMode value) { | 222 | protected void setter(VisualConnection object, ScaleMode value) { |
2811 | 216 | object.setScaleMode(value); | 223 | object.setScaleMode(value); |
2812 | 217 | } | 224 | } |
2813 | @@ -221,7 +228,7 @@ | |||
2814 | 221 | }); | 228 | }); |
2815 | 222 | 229 | ||
2816 | 223 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Color>( | 230 | addPropertyDeclaration(new PropertyDeclaration<VisualConnection, Color>( |
2818 | 224 | this, "Color", Color.class, true, true, true) { | 231 | this, PROPERTY_COLOR, Color.class, true, true, true) { |
2819 | 225 | protected void setter(VisualConnection object, Color value) { | 232 | protected void setter(VisualConnection object, Color value) { |
2820 | 226 | object.setColor(value); | 233 | object.setColor(value); |
2821 | 227 | } | 234 | } |
2822 | @@ -296,9 +303,9 @@ | |||
2823 | 296 | children.add(graphic); | 303 | children.add(graphic); |
2824 | 297 | observableHierarchyImpl.sendNotification(new NodesAddedEvent(this, getGraphic())); | 304 | observableHierarchyImpl.sendNotification(new NodesAddedEvent(this, getGraphic())); |
2825 | 298 | graphic.invalidate(); | 305 | graphic.invalidate(); |
2827 | 299 | observableStateImpl.sendNotification(new PropertyChangedEvent(this, "connectionType")); | 306 | observableStateImpl.sendNotification(new PropertyChangedEvent(this, PROPERTY_CONNECTION_TYPE)); |
2828 | 300 | } | 307 | } |
2830 | 301 | sendNotification(new PropertyChangedEvent(this, "connection type")); | 308 | sendNotification(new PropertyChangedEvent(this, PROPERTY_CONNECTION_TYPE)); |
2831 | 302 | } | 309 | } |
2832 | 303 | 310 | ||
2833 | 304 | public Color getColor() { | 311 | public Color getColor() { |
2834 | @@ -307,7 +314,7 @@ | |||
2835 | 307 | 314 | ||
2836 | 308 | public void setColor(Color color) { | 315 | public void setColor(Color color) { |
2837 | 309 | this.color = color; | 316 | this.color = color; |
2839 | 310 | sendNotification(new PropertyChangedEvent(this, "color")); | 317 | sendNotification(new PropertyChangedEvent(this, PROPERTY_COLOR)); |
2840 | 311 | } | 318 | } |
2841 | 312 | 319 | ||
2842 | 313 | @Override | 320 | @Override |
2843 | @@ -327,7 +334,7 @@ | |||
2844 | 327 | this.lineWidth = lineWidth; | 334 | this.lineWidth = lineWidth; |
2845 | 328 | 335 | ||
2846 | 329 | invalidate(); | 336 | invalidate(); |
2848 | 330 | sendNotification(new PropertyChangedEvent(this, "line width")); | 337 | sendNotification(new PropertyChangedEvent(this, PROPERTY_LINE_WIDTH)); |
2849 | 331 | } | 338 | } |
2850 | 332 | 339 | ||
2851 | 333 | @Override | 340 | @Override |
2852 | @@ -354,7 +361,7 @@ | |||
2853 | 354 | if (value < 0.0) value = 0.0; | 361 | if (value < 0.0) value = 0.0; |
2854 | 355 | this.arrowWidth = value; | 362 | this.arrowWidth = value; |
2855 | 356 | invalidate(); | 363 | invalidate(); |
2857 | 357 | sendNotification(new PropertyChangedEvent(this, "arrow width")); | 364 | sendNotification(new PropertyChangedEvent(this, PROPERTY_ARROW_WIDTH)); |
2858 | 358 | 365 | ||
2859 | 359 | } | 366 | } |
2860 | 360 | 367 | ||
2861 | @@ -369,7 +376,7 @@ | |||
2862 | 369 | if (value < 0.0) value = 0.0; | 376 | if (value < 0.0) value = 0.0; |
2863 | 370 | this.arrowLength = value; | 377 | this.arrowLength = value; |
2864 | 371 | invalidate(); | 378 | invalidate(); |
2866 | 372 | sendNotification(new PropertyChangedEvent(this, "arrow length")); | 379 | sendNotification(new PropertyChangedEvent(this, PROPERTY_ARROW_LENGTH)); |
2867 | 373 | } | 380 | } |
2868 | 374 | 381 | ||
2869 | 375 | public void invalidate() { | 382 | public void invalidate() { |
2870 | @@ -518,7 +525,7 @@ | |||
2871 | 518 | 525 | ||
2872 | 519 | public void setScaleMode(ScaleMode scaleMode) { | 526 | public void setScaleMode(ScaleMode scaleMode) { |
2873 | 520 | this.scaleMode = scaleMode; | 527 | this.scaleMode = scaleMode; |
2875 | 521 | sendNotification(new PropertyChangedEvent(this, "scale mode")); | 528 | sendNotification(new PropertyChangedEvent(this, PROPERTY_SCALE_MODE)); |
2876 | 522 | } | 529 | } |
2877 | 523 | 530 | ||
2878 | 524 | @Override | 531 | @Override |
2879 | 525 | 532 | ||
2880 | === modified file 'WorkcraftCore/src/org/workcraft/gui/DockableWindow.java' | |||
2881 | --- WorkcraftCore/src/org/workcraft/gui/DockableWindow.java 2014-09-05 14:09:00 +0000 | |||
2882 | +++ WorkcraftCore/src/org/workcraft/gui/DockableWindow.java 2015-06-26 22:23:53 +0000 | |||
2883 | @@ -134,8 +134,9 @@ | |||
2884 | 134 | for (Object d : port.getDockables()) { | 134 | for (Object d : port.getDockables()) { |
2885 | 135 | DockableWindow dockable = (DockableWindow)d; | 135 | DockableWindow dockable = (DockableWindow)d; |
2886 | 136 | boolean inTab = dockable.getComponent().getParent() instanceof JTabbedPane; | 136 | boolean inTab = dockable.getComponent().getParent() instanceof JTabbedPane; |
2887 | 137 | DockableWindowContentPanel contentPanel = dockable.getContentPanel(); | ||
2888 | 137 | if (inTab && !dockable.isMaximized()) { | 138 | if (inTab && !dockable.isMaximized()) { |
2890 | 138 | dockable.getContentPanel().setHeaderVisible(false); | 139 | contentPanel.setHeaderVisible(false); |
2891 | 139 | JTabbedPane tabbedPane = (JTabbedPane)dockable.getComponent().getParent(); | 140 | JTabbedPane tabbedPane = (JTabbedPane)dockable.getComponent().getParent(); |
2892 | 140 | for (int i=0; i<tabbedPane.getComponentCount(); i++) { | 141 | for (int i=0; i<tabbedPane.getComponentCount(); i++) { |
2893 | 141 | if (dockable.getComponent() == tabbedPane.getComponentAt(i)) { | 142 | if (dockable.getComponent() == tabbedPane.getComponentAt(i)) { |
2894 | @@ -144,17 +145,24 @@ | |||
2895 | 144 | } | 145 | } |
2896 | 145 | } | 146 | } |
2897 | 146 | } else { | 147 | } else { |
2899 | 147 | dockable.getContentPanel().setHeaderVisible(true); | 148 | contentPanel.setHeaderVisible(true); |
2900 | 148 | } | 149 | } |
2901 | 149 | } | 150 | } |
2902 | 150 | } | 151 | } |
2903 | 151 | 152 | ||
2904 | 153 | public void setTitle(String title) { | ||
2905 | 154 | if ( !getTitle().equals(title) ) { | ||
2906 | 155 | getContentPanel().setTitle(title); | ||
2907 | 156 | setTabText(title); | ||
2908 | 157 | } | ||
2909 | 158 | } | ||
2910 | 159 | |||
2911 | 152 | public String getTitle() { | 160 | public String getTitle() { |
2913 | 153 | return panel.getTitle(); | 161 | return getContentPanel().getTitle(); |
2914 | 154 | } | 162 | } |
2915 | 155 | 163 | ||
2916 | 156 | public int getID() { | 164 | public int getID() { |
2918 | 157 | return panel.getID(); | 165 | return getContentPanel().getID(); |
2919 | 158 | } | 166 | } |
2920 | 159 | 167 | ||
2921 | 160 | private static void processTabEvents(DockingPort port) { | 168 | private static void processTabEvents(DockingPort port) { |
2922 | 161 | 169 | ||
2923 | === modified file 'WorkcraftCore/src/org/workcraft/gui/DockableWindowContentPanel.java' | |||
2924 | --- WorkcraftCore/src/org/workcraft/gui/DockableWindowContentPanel.java 2014-12-12 18:43:40 +0000 | |||
2925 | +++ WorkcraftCore/src/org/workcraft/gui/DockableWindowContentPanel.java 2015-06-26 22:23:53 +0000 | |||
2926 | @@ -33,6 +33,7 @@ | |||
2927 | 33 | import javax.swing.JLabel; | 33 | import javax.swing.JLabel; |
2928 | 34 | import javax.swing.JPanel; | 34 | import javax.swing.JPanel; |
2929 | 35 | import javax.swing.UIManager; | 35 | import javax.swing.UIManager; |
2930 | 36 | import javax.swing.border.Border; | ||
2931 | 36 | 37 | ||
2932 | 37 | import org.workcraft.Framework; | 38 | import org.workcraft.Framework; |
2933 | 38 | import org.workcraft.exceptions.NotSupportedException; | 39 | import org.workcraft.exceptions.NotSupportedException; |
2934 | @@ -83,6 +84,7 @@ | |||
2935 | 83 | } | 84 | } |
2936 | 84 | 85 | ||
2937 | 85 | class DockableViewHeader extends JPanel { | 86 | class DockableViewHeader extends JPanel { |
2938 | 87 | private final Border BORDER_TITLE = BorderFactory.createEmptyBorder(1, 3, 1, 1); | ||
2939 | 86 | private ActionButton btnMin, btnMax, btnClose; | 88 | private ActionButton btnMin, btnMax, btnClose; |
2940 | 87 | private JLabel titleLabel = null; | 89 | private JLabel titleLabel = null; |
2941 | 88 | private JPanel buttonPanel = null; | 90 | private JPanel buttonPanel = null; |
2942 | @@ -148,10 +150,11 @@ | |||
2943 | 148 | buttonPanel.setPreferredSize(new Dimension((UIManager.getIcon("InternalFrame.closeIcon").getIconWidth()+4) * icons,UIManager.getIcon("InternalFrame.closeIcon").getIconHeight()+4)); | 150 | buttonPanel.setPreferredSize(new Dimension((UIManager.getIcon("InternalFrame.closeIcon").getIconWidth()+4) * icons,UIManager.getIcon("InternalFrame.closeIcon").getIconHeight()+4)); |
2944 | 149 | } | 151 | } |
2945 | 150 | 152 | ||
2947 | 151 | titleLabel = new JLabel(" "+ title); | 153 | titleLabel = new JLabel(title); |
2948 | 152 | titleLabel.setOpaque(false); | 154 | titleLabel.setOpaque(false); |
2949 | 153 | titleLabel.setForeground(UIManager.getColor("InternalFrame.activeTitleForeground")); | 155 | titleLabel.setForeground(UIManager.getColor("InternalFrame.activeTitleForeground")); |
2950 | 154 | titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD)); | 156 | titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD)); |
2951 | 157 | titleLabel.setBorder(BORDER_TITLE); | ||
2952 | 155 | add(titleLabel, BorderLayout.WEST); | 158 | add(titleLabel, BorderLayout.WEST); |
2953 | 156 | 159 | ||
2954 | 157 | setMaximized(false); | 160 | setMaximized(false); |
2955 | @@ -177,6 +180,7 @@ | |||
2956 | 177 | 180 | ||
2957 | 178 | public void setTitle(String title) { | 181 | public void setTitle(String title) { |
2958 | 179 | titleLabel.setText(title); | 182 | titleLabel.setText(title); |
2959 | 183 | titleLabel.repaint(); | ||
2960 | 180 | } | 184 | } |
2961 | 181 | } | 185 | } |
2962 | 182 | 186 | ||
2963 | 183 | 187 | ||
2964 | === renamed file 'WorkcraftCore/src/org/workcraft/gui/LAF.java' => 'WorkcraftCore/src/org/workcraft/gui/LookAndFeelHelper.java' | |||
2965 | --- WorkcraftCore/src/org/workcraft/gui/LAF.java 2009-09-22 21:01:45 +0000 | |||
2966 | +++ WorkcraftCore/src/org/workcraft/gui/LookAndFeelHelper.java 2015-06-26 22:23:53 +0000 | |||
2967 | @@ -21,23 +21,40 @@ | |||
2968 | 21 | 21 | ||
2969 | 22 | package org.workcraft.gui; | 22 | package org.workcraft.gui; |
2970 | 23 | 23 | ||
2988 | 24 | import javax.swing.UIManager; | 24 | import java.util.Collections; |
2989 | 25 | import javax.swing.UnsupportedLookAndFeelException; | 25 | import java.util.LinkedHashMap; |
2990 | 26 | 26 | import java.util.Map; | |
2991 | 27 | import org.jvnet.substance.SubstanceLookAndFeel; | 27 | |
2992 | 28 | import org.jvnet.substance.api.SubstanceConstants.TabContentPaneBorderKind; | 28 | import javax.swing.UIManager; |
2993 | 29 | 29 | import javax.swing.UnsupportedLookAndFeelException; | |
2994 | 30 | 30 | ||
2995 | 31 | public class LAF { | 31 | import org.jvnet.substance.SubstanceLookAndFeel; |
2996 | 32 | public static String currentLAF = UIManager.getLookAndFeel().getClass().getName(); | 32 | import org.jvnet.substance.api.SubstanceConstants.TabContentPaneBorderKind; |
2997 | 33 | 33 | ||
2998 | 34 | public static String getCurrentLAF() { | 34 | public class LookAndFeelHelper { |
2999 | 35 | return currentLAF; | 35 | |
3000 | 36 | } | 36 | private static Map<String, String> lafMap; |
3001 | 37 | 37 | ||
3002 | 38 | public static void setLAF(String LAF) { | 38 | public static Map<String, String> getLafMap() { |
3003 | 39 | try { | 39 | if (lafMap == null) { |
3004 | 40 | UIManager.setLookAndFeel(LAF); | 40 | lafMap = new LinkedHashMap<>(); |
3005 | 41 | lafMap.put("Metal (default)", "javax.swing.plaf.metal.MetalLookAndFeel"); | ||
3006 | 42 | lafMap.put("Windows", "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); | ||
3007 | 43 | lafMap.put("Substance: Moderate", "org.jvnet.substance.skin.SubstanceModerateLookAndFeel"); | ||
3008 | 44 | lafMap.put("Substance: Mist Silver", "org.jvnet.substance.skin.SubstanceMistSilverLookAndFeel"); | ||
3009 | 45 | lafMap.put("Substance: Raven", "org.jvnet.substance.skin.SubstanceRavenLookAndFeel"); | ||
3010 | 46 | lafMap.put("Substance: Business", "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel"); | ||
3011 | 47 | lafMap.put("Substance: Creme", "org.jvnet.substance.skin.SubstanceCremeCoffeeLookAndFeel"); | ||
3012 | 48 | } | ||
3013 | 49 | return Collections.unmodifiableMap(lafMap); | ||
3014 | 50 | } | ||
3015 | 51 | |||
3016 | 52 | public static void setLookAndFeel(String laf) { | ||
3017 | 53 | if (laf == null) { | ||
3018 | 54 | laf = UIManager.getSystemLookAndFeelClassName(); | ||
3019 | 55 | } | ||
3020 | 56 | try { | ||
3021 | 57 | UIManager.setLookAndFeel(laf); | ||
3022 | 41 | } catch (ClassNotFoundException e) { | 58 | } catch (ClassNotFoundException e) { |
3023 | 42 | e.printStackTrace(); | 59 | e.printStackTrace(); |
3024 | 43 | } catch (InstantiationException e) { | 60 | } catch (InstantiationException e) { |
3025 | @@ -47,16 +64,10 @@ | |||
3026 | 47 | } catch (UnsupportedLookAndFeelException e) { | 64 | } catch (UnsupportedLookAndFeelException e) { |
3027 | 48 | e.printStackTrace(); | 65 | e.printStackTrace(); |
3028 | 49 | } | 66 | } |
3039 | 50 | 67 | } | |
3040 | 51 | currentLAF = LAF; | 68 | |
3041 | 52 | } | 69 | public static void setSubstance(String laf) { |
3042 | 53 | 70 | setLookAndFeel(laf); | |
3033 | 54 | public static void setDefaultLAF() { | ||
3034 | 55 | setLAF(UIManager.getCrossPlatformLookAndFeelClassName()); | ||
3035 | 56 | } | ||
3036 | 57 | |||
3037 | 58 | public static void setSubstanceLAF(String LAF) { | ||
3038 | 59 | setLAF(LAF); | ||
3043 | 60 | UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND, TabContentPaneBorderKind.SINGLE_FULL); | 71 | UIManager.put(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND, TabContentPaneBorderKind.SINGLE_FULL); |
3044 | 61 | } | 72 | } |
3045 | 62 | } | 73 | } |
3046 | 63 | 74 | ||
3047 | === modified file 'WorkcraftCore/src/org/workcraft/gui/MainMenu.java' | |||
3048 | --- WorkcraftCore/src/org/workcraft/gui/MainMenu.java 2015-02-11 10:58:21 +0000 | |||
3049 | +++ WorkcraftCore/src/org/workcraft/gui/MainMenu.java 2015-06-26 22:23:53 +0000 | |||
3050 | @@ -29,6 +29,7 @@ | |||
3051 | 29 | import java.util.Collection; | 29 | import java.util.Collection; |
3052 | 30 | import java.util.Collections; | 30 | import java.util.Collections; |
3053 | 31 | import java.util.HashMap; | 31 | import java.util.HashMap; |
3054 | 32 | import java.util.LinkedList; | ||
3055 | 32 | import java.util.List; | 33 | import java.util.List; |
3056 | 33 | 34 | ||
3057 | 34 | import javax.swing.JLabel; | 35 | import javax.swing.JLabel; |
3058 | @@ -119,34 +120,15 @@ | |||
3059 | 119 | final private JMenu mnExport = new JMenu("Export"); | 120 | final private JMenu mnExport = new JMenu("Export"); |
3060 | 120 | final private JMenu mnRecent = new JMenu("Open recent"); | 121 | final private JMenu mnRecent = new JMenu("Open recent"); |
3061 | 121 | final private JMenu mnWindows = new JMenu("Windows"); | 122 | final private JMenu mnWindows = new JMenu("Windows"); |
3064 | 122 | final private JMenu mnTools = new JMenu("Tools"); | 123 | final private HashMap <Integer, ActionCheckBoxMenuItem> windowItems = new HashMap<Integer, ActionCheckBoxMenuItem>(); |
3065 | 123 | final private HashMap <Integer, ActionCheckBoxMenuItem> windowItems = new HashMap<Integer, ActionCheckBoxMenuItem>(); | 124 | final private LinkedList<JMenu> mnToolsList = new LinkedList<>(); |
3066 | 125 | final private JMenu mnHelp = new JMenu("Help"); | ||
3067 | 124 | 126 | ||
3068 | 125 | private String[] lafCaptions = new String[] { | ||
3069 | 126 | "Java default", | ||
3070 | 127 | "Windows", | ||
3071 | 128 | "Substance: Moderate", | ||
3072 | 129 | "Substance: Mist Silver", | ||
3073 | 130 | "Substance: Raven", | ||
3074 | 131 | "Substance: Business", | ||
3075 | 132 | "Substance: Creme" | ||
3076 | 133 | }; | ||
3077 | 134 | private String[] lafClasses = new String[] { | ||
3078 | 135 | "javax.swing.plaf.metal.MetalLookAndFeel", | ||
3079 | 136 | "com.sun.java.swing.plaf.windows.WindowsLookAndFeel", | ||
3080 | 137 | "org.jvnet.substance.skin.SubstanceModerateLookAndFeel", | ||
3081 | 138 | "org.jvnet.substance.skin.SubstanceMistSilverLookAndFeel", | ||
3082 | 139 | "org.jvnet.substance.skin.SubstanceRavenLookAndFeel", | ||
3083 | 140 | "org.jvnet.substance.skin.SubstanceBusinessLookAndFeel", | ||
3084 | 141 | "org.jvnet.substance.skin.SubstanceCremeCoffeeLookAndFeel" | ||
3085 | 142 | }; | ||
3086 | 143 | |||
3087 | 144 | MainMenu(final MainWindow mainWindow) { | 127 | MainMenu(final MainWindow mainWindow) { |
3088 | 145 | this.mainWindow = mainWindow; | 128 | this.mainWindow = mainWindow; |
3089 | 146 | addFileMenu(mainWindow); | 129 | addFileMenu(mainWindow); |
3090 | 147 | addEditMenu(mainWindow); | 130 | addEditMenu(mainWindow); |
3091 | 148 | addViewMenu(mainWindow); | 131 | addViewMenu(mainWindow); |
3092 | 149 | add(mnTools); | ||
3093 | 150 | addHelpMenu(mainWindow); | 132 | addHelpMenu(mainWindow); |
3094 | 151 | } | 133 | } |
3095 | 152 | 134 | ||
3096 | @@ -225,7 +207,7 @@ | |||
3097 | 225 | mnFile.add(miImport); | 207 | mnFile.add(miImport); |
3098 | 226 | mnFile.add(mnExport); | 208 | mnFile.add(mnExport); |
3099 | 227 | 209 | ||
3101 | 228 | // FIXME: Workspace functionality is not working yet. | 210 | // FIXME: Workspace functionality is not working yet. |
3102 | 229 | // mnFile.addSeparator(); | 211 | // mnFile.addSeparator(); |
3103 | 230 | // mnFile.add(miNewWorkspace); | 212 | // mnFile.add(miNewWorkspace); |
3104 | 231 | // mnFile.add(miOpenWorkspace); | 213 | // mnFile.add(miOpenWorkspace); |
3105 | @@ -362,29 +344,28 @@ | |||
3106 | 362 | miPanCenter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.CTRL_MASK)); | 344 | miPanCenter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.CTRL_MASK)); |
3107 | 363 | miPanCenter.addScriptedActionListener(mainWindow.getDefaultActionListener()); | 345 | miPanCenter.addScriptedActionListener(mainWindow.getDefaultActionListener()); |
3108 | 364 | 346 | ||
3132 | 365 | JMenu mnLAF = new JMenu("Look and Feel"); | 347 | // FIXME: Only the default Look and Feel works good, the others cause some problems. |
3133 | 366 | for (int i = 0; i < lafClasses.length; i++) { | 348 | // JMenu mnLookAndFeel = new JMenu("Look and Feel"); |
3134 | 367 | JMenuItem miLAFItem = new JMenuItem(); | 349 | // for (final Entry<String, String> laf: LookAndFeelHelper.getLafMap().entrySet()) { |
3135 | 368 | miLAFItem.setText(lafCaptions[i]); | 350 | // JMenuItem miLAFItem = new JMenuItem(); |
3136 | 369 | final String lafClass = lafClasses[i]; | 351 | // miLAFItem.setText(laf.getKey()); |
3137 | 370 | miLAFItem.addActionListener(new ActionListener() { | 352 | // miLAFItem.addActionListener(new ActionListener() { |
3138 | 371 | public void actionPerformed(ActionEvent e) { | 353 | // public void actionPerformed(ActionEvent e) { |
3139 | 372 | try { | 354 | // try { |
3140 | 373 | mainWindow.setLAF(lafClass); | 355 | // mainWindow.setLookAndFeel(laf.getValue()); |
3141 | 374 | } catch (OperationCancelledException e1) { | 356 | // } catch (OperationCancelledException e1) { |
3142 | 375 | } | 357 | // } |
3143 | 376 | } | 358 | // } |
3144 | 377 | }); | 359 | // }); |
3145 | 378 | mnLAF.add(miLAFItem); | 360 | // mnLookAndFeel.add(miLAFItem); |
3146 | 379 | } | 361 | // } |
3147 | 380 | 362 | ||
3148 | 381 | /* ScriptedActionMenuItem miSaveLayout = new ScriptedActionMenuItem(MainWindow.Actions.SAVE_UI_LAYOUT); | 363 | // FIXME: Save-load of the layout is not functional yet. |
3149 | 382 | miSaveLayout.addScriptedActionListener(mainWindow.getDefaultActionListener()); | 364 | // ScriptedActionMenuItem miSaveLayout = new ScriptedActionMenuItem(MainWindow.Actions.SAVE_UI_LAYOUT); |
3150 | 383 | mnView.add(miSaveLayout); | 365 | // miSaveLayout.addScriptedActionListener(mainWindow.getDefaultActionListener()); |
3151 | 384 | 366 | // | |
3152 | 385 | ScriptedActionMenuItem miLoadLayout = new ScriptedActionMenuItem(MainWindow.Actions.LOAD_UI_LAYOUT); | 367 | // ScriptedActionMenuItem miLoadLayout = new ScriptedActionMenuItem(MainWindow.Actions.LOAD_UI_LAYOUT); |
3153 | 386 | miLoadLayout.addScriptedActionListener(mainWindow.getDefaultActionListener()); | 368 | // miLoadLayout.addScriptedActionListener(mainWindow.getDefaultActionListener()); |
3131 | 387 | mnView.add(miLoadLayout);*/ | ||
3154 | 388 | 369 | ||
3155 | 389 | ActionMenuItem miResetLayout = new ActionMenuItem(MainWindowActions.RESET_GUI_ACTION); | 370 | ActionMenuItem miResetLayout = new ActionMenuItem(MainWindowActions.RESET_GUI_ACTION); |
3156 | 390 | miResetLayout.addScriptedActionListener(mainWindow.getDefaultActionListener()); | 371 | miResetLayout.addScriptedActionListener(mainWindow.getDefaultActionListener()); |
3157 | @@ -401,15 +382,17 @@ | |||
3158 | 401 | mnView.add(miPanDown); | 382 | mnView.add(miPanDown); |
3159 | 402 | mnView.addSeparator(); | 383 | mnView.addSeparator(); |
3160 | 403 | mnView.add(mnWindows); | 384 | mnView.add(mnWindows); |
3162 | 404 | mnView.add(mnLAF); | 385 | // mnView.add(mnLookAndFeel); |
3163 | 386 | // mnView.addSeparator(); | ||
3164 | 405 | mnView.add(miResetLayout); | 387 | mnView.add(miResetLayout); |
3166 | 406 | 388 | // mnView.add(miSaveLayout); | |
3167 | 389 | // mnView.add(miLoadLayout); | ||
3168 | 407 | 390 | ||
3169 | 408 | add(mnView); | 391 | add(mnView); |
3170 | 409 | } | 392 | } |
3171 | 410 | 393 | ||
3172 | 411 | private void addHelpMenu(final MainWindow mainWindow) { | 394 | private void addHelpMenu(final MainWindow mainWindow) { |
3174 | 412 | JMenu mnHelp = new JMenu(); | 395 | //JMenu mnHelp = new JMenu(); |
3175 | 413 | mnHelp.setText("Help"); | 396 | mnHelp.setText("Help"); |
3176 | 414 | 397 | ||
3177 | 415 | ActionMenuItem miOverview = new ActionMenuItem(MainWindowActions.HELP_OVERVIEW_ACTION); | 398 | ActionMenuItem miOverview = new ActionMenuItem(MainWindowActions.HELP_OVERVIEW_ACTION); |
3178 | @@ -439,16 +422,11 @@ | |||
3179 | 439 | mnHelp.add(miQuestion); | 422 | mnHelp.add(miQuestion); |
3180 | 440 | mnHelp.addSeparator(); | 423 | mnHelp.addSeparator(); |
3181 | 441 | mnHelp.add(miAbout); | 424 | mnHelp.add(miAbout); |
3183 | 442 | 425 | ||
3184 | 426 | //add(Box.createHorizontalGlue()); | ||
3185 | 443 | add(mnHelp); | 427 | add(mnHelp); |
3186 | 444 | } | 428 | } |
3187 | 445 | 429 | ||
3188 | 446 | final public void setMenuForWorkspaceEntry(final WorkspaceEntry we) { | ||
3189 | 447 | we.updateActionState(); | ||
3190 | 448 | setToolsMenu(we); | ||
3191 | 449 | setExportMenu(we); | ||
3192 | 450 | } | ||
3193 | 451 | |||
3194 | 452 | private void setExportMenu(final WorkspaceEntry we) { | 430 | private void setExportMenu(final WorkspaceEntry we) { |
3195 | 453 | mnExport.removeAll(); | 431 | mnExport.removeAll(); |
3196 | 454 | mnExport.setEnabled(false); | 432 | mnExport.setEnabled(false); |
3197 | @@ -481,36 +459,19 @@ | |||
3198 | 481 | haveNonVisual = true; | 459 | haveNonVisual = true; |
3199 | 482 | } | 460 | } |
3200 | 483 | } | 461 | } |
3231 | 484 | } | 462 | revalidate(); |
3232 | 485 | 463 | } | |
3233 | 486 | private void setToolsMenu(final WorkspaceEntry we) { | 464 | |
3234 | 487 | mnTools.setVisible(true); | 465 | public void setExportMenuState(boolean enable) { |
3235 | 488 | mnTools.removeAll(); | 466 | mnExport.setEnabled(enable); |
3236 | 489 | 467 | } | |
3237 | 490 | ListMap<String, Pair<String, Tool>> tools = Tools.getTools(we); | 468 | |
3238 | 491 | List<String> sections = Tools.getSections(tools); | 469 | final public void registerUtilityWindow(DockableWindow window) { |
3239 | 492 | 470 | ActionCheckBoxMenuItem miWindowItem = new ActionCheckBoxMenuItem(new ToggleWindowAction(window)); | |
3240 | 493 | for (String section : sections) { | 471 | miWindowItem.addScriptedActionListener(mainWindow.getDefaultActionListener()); |
3241 | 494 | JMenu target = mnTools; | 472 | miWindowItem.setSelected(!window.isClosed()); |
3242 | 495 | if (!section.isEmpty()) { | 473 | windowItems.put(window.getID(), miWindowItem); |
3243 | 496 | JMenu sectionMenu = new JMenu (section); | 474 | mnWindows.add(miWindowItem); |
3214 | 497 | mnTools.add(sectionMenu); | ||
3215 | 498 | target = sectionMenu; | ||
3216 | 499 | } | ||
3217 | 500 | for (Pair<String, Tool> tool : Tools.getSectionTools(section, tools)) { | ||
3218 | 501 | ActionMenuItem miTool = new ActionMenuItem(new ToolAction(tool)); | ||
3219 | 502 | miTool.addScriptedActionListener(mainWindow.getDefaultActionListener()); | ||
3220 | 503 | target.add(miTool); | ||
3221 | 504 | } | ||
3222 | 505 | } | ||
3223 | 506 | } | ||
3224 | 507 | |||
3225 | 508 | final public void registerUtilityWindow(DockableWindow window) { | ||
3226 | 509 | ActionCheckBoxMenuItem miWindowItem = new ActionCheckBoxMenuItem(new ToggleWindowAction(window)); | ||
3227 | 510 | miWindowItem.addScriptedActionListener(mainWindow.getDefaultActionListener()); | ||
3228 | 511 | miWindowItem.setSelected(!window.isClosed()); | ||
3229 | 512 | windowItems.put (window.getID(), miWindowItem); | ||
3230 | 513 | mnWindows.add(miWindowItem); | ||
3244 | 514 | } | 475 | } |
3245 | 515 | 476 | ||
3246 | 516 | final public void setRecentMenu(ArrayList<String> entries) { | 477 | final public void setRecentMenu(ArrayList<String> entries) { |
3247 | @@ -547,35 +508,76 @@ | |||
3248 | 547 | } | 508 | } |
3249 | 548 | }); | 509 | }); |
3250 | 549 | mnRecent.add(miClear); | 510 | mnRecent.add(miClear); |
3280 | 550 | } | 511 | } |
3281 | 551 | 512 | ||
3282 | 552 | final public void utilityWindowClosed (int ID) { | 513 | final public void utilityWindowClosed (int ID) { |
3283 | 553 | ActionCheckBoxMenuItem mi = windowItems.get(ID); | 514 | ActionCheckBoxMenuItem mi = windowItems.get(ID); |
3284 | 554 | if (mi!=null) | 515 | if (mi!=null) |
3285 | 555 | mi.setSelected(false); | 516 | mi.setSelected(false); |
3286 | 556 | } | 517 | } |
3287 | 557 | 518 | ||
3288 | 558 | final public void utilityWindowDisplayed (int ID) { | 519 | final public void utilityWindowDisplayed (int ID) { |
3289 | 559 | ActionCheckBoxMenuItem mi = windowItems.get(ID); | 520 | ActionCheckBoxMenuItem mi = windowItems.get(ID); |
3290 | 560 | if (mi!=null) | 521 | if (mi!=null) |
3291 | 561 | mi.setSelected(true); | 522 | mi.setSelected(true); |
3292 | 562 | } | 523 | } |
3293 | 563 | 524 | ||
3294 | 564 | public void reset() { | 525 | private void createToolsMenu(final WorkspaceEntry we) { |
3295 | 565 | mnTools.setVisible(false); | 526 | removeToolsMenu(); |
3296 | 566 | mnTools.removeAll(); | 527 | |
3297 | 567 | } | 528 | ListMap<String, Pair<String, Tool>> tools = Tools.getTools(we); |
3298 | 568 | 529 | List<String> sections = Tools.getSections(tools); | |
3299 | 569 | public JMenu getRecentMenu() { | 530 | |
3300 | 570 | return mnRecent; | 531 | JMenu mnTools = new JMenu("Tools"); |
3301 | 571 | } | 532 | mnToolsList.clear(); |
3302 | 572 | 533 | for (String section : sections) { | |
3303 | 573 | public JMenu getExportMenu() { | 534 | JMenu mnSection = mnTools; |
3304 | 574 | return mnExport; | 535 | if (!section.isEmpty()) { |
3305 | 575 | } | 536 | mnSection = new JMenu(section); |
3306 | 576 | 537 | boolean promote = section.startsWith("!"); | |
3307 | 577 | public JMenu getToolsMenu() { | 538 | if (promote) { |
3308 | 578 | return mnTools; | 539 | mnSection.setText(section.substring(1)); |
3309 | 540 | mnToolsList.add(mnSection); | ||
3310 | 541 | } else { | ||
3311 | 542 | mnTools.add(mnSection); | ||
3312 | 543 | mnToolsList.addFirst(mnTools); | ||
3313 | 544 | } | ||
3314 | 545 | } | ||
3315 | 546 | for (Pair<String, Tool> tool : Tools.getSectionTools(section, tools)) { | ||
3316 | 547 | ActionMenuItem miTool = new ActionMenuItem(new ToolAction(tool)); | ||
3317 | 548 | miTool.addScriptedActionListener(mainWindow.getDefaultActionListener()); | ||
3318 | 549 | mnSection.add(miTool); | ||
3319 | 550 | } | ||
3320 | 551 | } | ||
3321 | 552 | addToolsMenu(); | ||
3322 | 553 | } | ||
3323 | 554 | |||
3324 | 555 | private void addToolsMenu() { | ||
3325 | 556 | for (JMenu mnTools: mnToolsList) { | ||
3326 | 557 | add(mnTools); | ||
3327 | 558 | } | ||
3328 | 559 | remove(mnHelp); | ||
3329 | 560 | add(mnHelp); | ||
3330 | 561 | revalidate(); | ||
3331 | 562 | } | ||
3332 | 563 | |||
3333 | 564 | public void removeToolsMenu() { | ||
3334 | 565 | for (JMenu mnTools: mnToolsList) { | ||
3335 | 566 | remove(mnTools); | ||
3336 | 567 | } | ||
3337 | 568 | revalidate(); | ||
3338 | 569 | } | ||
3339 | 570 | |||
3340 | 571 | public void updateToolsMenuState(boolean enable) { | ||
3341 | 572 | for (JMenu mnTool: mnToolsList) { | ||
3342 | 573 | mnTool.setEnabled(enable); | ||
3343 | 574 | } | ||
3344 | 575 | } | ||
3345 | 576 | |||
3346 | 577 | public void setMenuForWorkspaceEntry(final WorkspaceEntry we) { | ||
3347 | 578 | we.updateActionState(); | ||
3348 | 579 | createToolsMenu(we); | ||
3349 | 580 | setExportMenu(we); | ||
3350 | 579 | } | 581 | } |
3351 | 580 | 582 | ||
3352 | 581 | } | 583 | } |
3353 | 582 | 584 | ||
3354 | === modified file 'WorkcraftCore/src/org/workcraft/gui/MainWindow.java' | |||
3355 | --- WorkcraftCore/src/org/workcraft/gui/MainWindow.java 2015-04-28 11:37:35 +0000 | |||
3356 | +++ WorkcraftCore/src/org/workcraft/gui/MainWindow.java 2015-06-26 22:23:53 +0000 | |||
3357 | @@ -114,6 +114,16 @@ | |||
3358 | 114 | 114 | ||
3359 | 115 | @SuppressWarnings("serial") | 115 | @SuppressWarnings("serial") |
3360 | 116 | public class MainWindow extends JFrame { | 116 | public class MainWindow extends JFrame { |
3361 | 117 | public static final String TITLE_OUTPUT = "Output"; | ||
3362 | 118 | public static final String TITLE_PROBLEMS = "Problems"; | ||
3363 | 119 | public static final String TITLE_JAVASCRIPT = "Javascript"; | ||
3364 | 120 | public static final String TITLE_TASKS = "Tasks"; | ||
3365 | 121 | public static final String TITLE_WORKSPACE = "Workspace"; | ||
3366 | 122 | public static final String TITLE_PROPERTY_EDITOR = "Property editor"; | ||
3367 | 123 | public static final String TITLE_TOOL_CONTROLS = "Tool controls"; | ||
3368 | 124 | public static final String TITLE_EDITOR_TOOLS = "Editor tools"; | ||
3369 | 125 | public static final String TITLE_PLACEHOLDER = ""; | ||
3370 | 126 | |||
3371 | 117 | private static final String UILAYOUT_PATH = "./config/uilayout.xml"; | 127 | private static final String UILAYOUT_PATH = "./config/uilayout.xml"; |
3372 | 118 | private static final int VIEWPORT_MARGIN = 30; | 128 | private static final int VIEWPORT_MARGIN = 30; |
3373 | 119 | 129 | ||
3374 | @@ -182,14 +192,13 @@ | |||
3375 | 182 | }); | 192 | }); |
3376 | 183 | } | 193 | } |
3377 | 184 | 194 | ||
3380 | 185 | public void setLAF(String laf) throws OperationCancelledException { | 195 | public void setLookAndFeel(String laf) throws OperationCancelledException { |
3381 | 186 | if (JOptionPane.showConfirmDialog(this, | 196 | int dialogResult = JOptionPane.showConfirmDialog(this, |
3382 | 187 | "Changing Look and Feel requires GUI restart.\n\n" | 197 | "Changing Look and Feel requires GUI restart.\n\n" |
3383 | 188 | + "This will cause the visual editor windows to be closed.\n\nProceed?", | 198 | + "This will cause the visual editor windows to be closed.\n\nProceed?", |
3387 | 189 | "Confirm", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { | 199 | "Confirm", JOptionPane.YES_NO_OPTION); |
3385 | 190 | if (laf == null) | ||
3386 | 191 | laf = UIManager.getSystemLookAndFeelClassName(); | ||
3388 | 192 | 200 | ||
3389 | 201 | if (dialogResult == JOptionPane.YES_OPTION) { | ||
3390 | 193 | final Framework framework = Framework.getInstance(); | 202 | final Framework framework = Framework.getInstance(); |
3391 | 194 | framework.setConfigVar("gui.lookandfeel", laf); | 203 | framework.setConfigVar("gui.lookandfeel", laf); |
3392 | 195 | framework.restartGUI(); | 204 | framework.restartGUI(); |
3393 | @@ -201,9 +210,9 @@ | |||
3394 | 201 | } | 210 | } |
3395 | 202 | 211 | ||
3396 | 203 | private DockableWindow createDockableWindow(JComponent component, | 212 | private DockableWindow createDockableWindow(JComponent component, |
3400 | 204 | String name, Dockable neighbour, int options) { | 213 | String title, Dockable neighbour, int options) { |
3401 | 205 | return createDockableWindow(component, name, neighbour, options, | 214 | return createDockableWindow(component, title, neighbour, options, |
3402 | 206 | DockingConstants.CENTER_REGION, name); | 215 | DockingConstants.CENTER_REGION, title); |
3403 | 207 | } | 216 | } |
3404 | 208 | 217 | ||
3405 | 209 | private DockableWindow createDockableWindow(JComponent component, | 218 | private DockableWindow createDockableWindow(JComponent component, |
3406 | @@ -374,10 +383,8 @@ | |||
3407 | 374 | 383 | ||
3408 | 375 | final Framework framework = Framework.getInstance(); | 384 | final Framework framework = Framework.getInstance(); |
3409 | 376 | String laf = framework.getConfigVar("gui.lookandfeel"); | 385 | String laf = framework.getConfigVar("gui.lookandfeel"); |
3414 | 377 | if (laf == null) { | 386 | SilverOceanTheme.enable(); |
3415 | 378 | laf = UIManager.getCrossPlatformLookAndFeelClassName(); | 387 | LookAndFeelHelper.setLookAndFeel(laf); |
3412 | 379 | } | ||
3413 | 380 | LAF.setLAF(laf); | ||
3416 | 381 | SwingUtilities.updateComponentTreeUI(this); | 388 | SwingUtilities.updateComponentTreeUI(this); |
3417 | 382 | 389 | ||
3418 | 383 | content = new JPanel(new BorderLayout(0, 0)); | 390 | content = new JPanel(new BorderLayout(0, 0)); |
3419 | @@ -426,49 +433,49 @@ | |||
3420 | 426 | float xSplit = 0.88f; | 433 | float xSplit = 0.88f; |
3421 | 427 | float ySplit = 0.82f; | 434 | float ySplit = 0.82f; |
3422 | 428 | outputDockable = createDockableWindow( | 435 | outputDockable = createDockableWindow( |
3424 | 429 | outputWindow, "Output", | 436 | outputWindow, TITLE_OUTPUT, |
3425 | 430 | DockableWindowContentPanel.CLOSE_BUTTON, | 437 | DockableWindowContentPanel.CLOSE_BUTTON, |
3426 | 431 | DockingManager.SOUTH_REGION, ySplit); | 438 | DockingManager.SOUTH_REGION, ySplit); |
3427 | 432 | 439 | ||
3428 | 433 | erroDockable = createDockableWindow( | 440 | erroDockable = createDockableWindow( |
3430 | 434 | errorWindow, "Problems", outputDockable, | 441 | errorWindow, TITLE_PROBLEMS, outputDockable, |
3431 | 435 | DockableWindowContentPanel.CLOSE_BUTTON); | 442 | DockableWindowContentPanel.CLOSE_BUTTON); |
3432 | 436 | 443 | ||
3433 | 437 | javaScriptDockable = createDockableWindow( | 444 | javaScriptDockable = createDockableWindow( |
3435 | 438 | javaScriptWindow, "Javascript", outputDockable, | 445 | javaScriptWindow, TITLE_JAVASCRIPT, outputDockable, |
3436 | 446 | DockableWindowContentPanel.CLOSE_BUTTON); | ||
3437 | 447 | |||
3438 | 448 | tasksDockable = createDockableWindow( | ||
3439 | 449 | new TaskManagerWindow(), TITLE_TASKS, outputDockable, | ||
3440 | 439 | DockableWindowContentPanel.CLOSE_BUTTON); | 450 | DockableWindowContentPanel.CLOSE_BUTTON); |
3441 | 440 | 451 | ||
3442 | 441 | workspaceDockable = createDockableWindow( | 452 | workspaceDockable = createDockableWindow( |
3444 | 442 | workspaceWindow, "Workspace", | 453 | workspaceWindow, TITLE_WORKSPACE, |
3445 | 443 | DockableWindowContentPanel.CLOSE_BUTTON, | 454 | DockableWindowContentPanel.CLOSE_BUTTON, |
3446 | 444 | DockingManager.EAST_REGION, xSplit); | 455 | DockingManager.EAST_REGION, xSplit); |
3447 | 445 | 456 | ||
3448 | 446 | propertyEditorDockable = createDockableWindow( | 457 | propertyEditorDockable = createDockableWindow( |
3450 | 447 | propertyEditorWindow, "Property editor", workspaceDockable, | 458 | propertyEditorWindow, TITLE_PROPERTY_EDITOR, workspaceDockable, |
3451 | 448 | DockableWindowContentPanel.CLOSE_BUTTON, | 459 | DockableWindowContentPanel.CLOSE_BUTTON, |
3452 | 449 | DockingManager.NORTH_REGION, ySplit); | 460 | DockingManager.NORTH_REGION, ySplit); |
3453 | 450 | 461 | ||
3454 | 451 | toolControlsDockable = createDockableWindow( | 462 | toolControlsDockable = createDockableWindow( |
3456 | 452 | editorToolsWindow, "Tool controls", propertyEditorDockable, | 463 | editorToolsWindow, TITLE_TOOL_CONTROLS, propertyEditorDockable, |
3457 | 453 | DockableWindowContentPanel.CLOSE_BUTTON, | 464 | DockableWindowContentPanel.CLOSE_BUTTON, |
3458 | 454 | DockingManager.SOUTH_REGION, 0.4f); | 465 | DockingManager.SOUTH_REGION, 0.4f); |
3459 | 455 | 466 | ||
3460 | 456 | editorToolsDockable = createDockableWindow( | 467 | editorToolsDockable = createDockableWindow( |
3462 | 457 | toolControlsWindow, "Editor tools", toolControlsDockable, | 468 | toolControlsWindow, TITLE_EDITOR_TOOLS, toolControlsDockable, |
3463 | 458 | DockableWindowContentPanel.HEADER | DockableWindowContentPanel.CLOSE_BUTTON, | 469 | DockableWindowContentPanel.HEADER | DockableWindowContentPanel.CLOSE_BUTTON, |
3464 | 459 | DockingManager.SOUTH_REGION, 0.82f); | 470 | DockingManager.SOUTH_REGION, 0.82f); |
3465 | 460 | 471 | ||
3466 | 461 | documentPlaceholder = createDockableWindow( | 472 | documentPlaceholder = createDockableWindow( |
3468 | 462 | new DocumentPlaceholder(), "", null, outputDockable, | 473 | new DocumentPlaceholder(), TITLE_PLACEHOLDER, null, outputDockable, |
3469 | 463 | 0, DockingManager.NORTH_REGION, ySplit, "DocumentPlaceholder"); | 474 | 0, DockingManager.NORTH_REGION, ySplit, "DocumentPlaceholder"); |
3470 | 464 | 475 | ||
3471 | 465 | DockingManager.display(outputDockable); | 476 | DockingManager.display(outputDockable); |
3472 | 466 | EffectsManager.setPreview(new AlphaPreview(Color.BLACK, Color.GRAY, 0.5f)); | 477 | EffectsManager.setPreview(new AlphaPreview(Color.BLACK, Color.GRAY, 0.5f)); |
3473 | 467 | 478 | ||
3474 | 468 | tasksDockable = createDockableWindow( | ||
3475 | 469 | new TaskManagerWindow(), "Tasks", outputDockable, | ||
3476 | 470 | DockableWindowContentPanel.CLOSE_BUTTON); | ||
3477 | 471 | |||
3478 | 472 | setVisible(true); | 479 | setVisible(true); |
3479 | 473 | loadDockingLayout(); | 480 | loadDockingLayout(); |
3480 | 474 | 481 | ||
3481 | @@ -492,7 +499,7 @@ | |||
3482 | 492 | // createGlyphVector is called for the first time | 499 | // createGlyphVector is called for the first time |
3483 | 493 | Font font = new Font("Sans-serif", Font.PLAIN, 1); | 500 | Font font = new Font("Sans-serif", Font.PLAIN, 1); |
3484 | 494 | font.createGlyphVector(new FontRenderContext( | 501 | font.createGlyphVector(new FontRenderContext( |
3486 | 495 | new AffineTransform(), true, true), ""); | 502 | new AffineTransform(), true, true), TITLE_PLACEHOLDER); |
3487 | 496 | 503 | ||
3488 | 497 | // force svg rendering classes to load | 504 | // force svg rendering classes to load |
3489 | 498 | GUI.createIconFromSVG("images/icons/svg/place.svg"); | 505 | GUI.createIconFromSVG("images/icons/svg/place.svg"); |
3490 | @@ -503,7 +510,7 @@ | |||
3491 | 503 | } | 510 | } |
3492 | 504 | 511 | ||
3493 | 505 | private void setWorkActionsEnableness(boolean enable) { | 512 | private void setWorkActionsEnableness(boolean enable) { |
3495 | 506 | getMainMenu().getExportMenu().setEnabled(enable); | 513 | getMainMenu().setExportMenuState(enable); |
3496 | 507 | MainWindowActions.MERGE_WORK_ACTION.setEnabled(enable); | 514 | MainWindowActions.MERGE_WORK_ACTION.setEnabled(enable); |
3497 | 508 | MainWindowActions.CLOSE_ACTIVE_EDITOR_ACTION.setEnabled(enable); | 515 | MainWindowActions.CLOSE_ACTIVE_EDITOR_ACTION.setEnabled(enable); |
3498 | 509 | MainWindowActions.CLOSE_ALL_EDITORS_ACTION.setEnabled(enable); | 516 | MainWindowActions.CLOSE_ALL_EDITORS_ACTION.setEnabled(enable); |
3499 | @@ -588,8 +595,9 @@ | |||
3500 | 588 | 595 | ||
3501 | 589 | if (editorInFocus == editor) { | 596 | if (editorInFocus == editor) { |
3502 | 590 | toolControlsWindow.setContent(null); | 597 | toolControlsWindow.setContent(null); |
3504 | 591 | mainMenu.reset(); | 598 | mainMenu.removeToolsMenu(); |
3505 | 592 | editorInFocus = null; | 599 | editorInFocus = null; |
3506 | 600 | setDockableTitle(getPropertyEditor(), TITLE_PROPERTY_EDITOR); | ||
3507 | 593 | } | 601 | } |
3508 | 594 | 602 | ||
3509 | 595 | editorWindows.remove(we, dockableWindow); | 603 | editorWindows.remove(we, dockableWindow); |
3510 | @@ -841,11 +849,7 @@ | |||
3511 | 841 | 849 | ||
3512 | 842 | toolControlsWindow.setContent(sender.getToolBox()); | 850 | toolControlsWindow.setContent(sender.getToolBox()); |
3513 | 843 | editorToolsWindow.setContent(sender.getToolBox().getControlPanel()); | 851 | editorToolsWindow.setContent(sender.getToolBox().getControlPanel()); |
3514 | 844 | |||
3515 | 845 | mainMenu.setMenuForWorkspaceEntry(editorInFocus.getWorkspaceEntry()); | 852 | mainMenu.setMenuForWorkspaceEntry(editorInFocus.getWorkspaceEntry()); |
3516 | 846 | |||
3517 | 847 | mainMenu.revalidate(); | ||
3518 | 848 | mainMenu.repaint(); | ||
3519 | 849 | sender.updatePropertyView(); | 853 | sender.updatePropertyView(); |
3520 | 850 | 854 | ||
3521 | 851 | framework.deleteJavaScriptProperty("visualModel", framework.getJavaScriptGlobalScope()); | 855 | framework.deleteJavaScriptProperty("visualModel", framework.getJavaScriptGlobalScope()); |
3522 | @@ -1045,7 +1049,7 @@ | |||
3523 | 1045 | JOptionPane.showMessageDialog(this, e.getMessage(), "Model export failed", JOptionPane.ERROR_MESSAGE); | 1049 | JOptionPane.showMessageDialog(this, e.getMessage(), "Model export failed", JOptionPane.ERROR_MESSAGE); |
3524 | 1046 | } | 1050 | } |
3525 | 1047 | we.setChanged(false); | 1051 | we.setChanged(false); |
3527 | 1048 | refreshTitle(we); | 1052 | refreshWorkspaceEntryTitle(we, true); |
3528 | 1049 | lastSavePath = we.getFile().getParent(); | 1053 | lastSavePath = we.getFile().getParent(); |
3529 | 1050 | pushRecentFile(we.getFile().getPath(), true); | 1054 | pushRecentFile(we.getFile().getPath(), true); |
3530 | 1051 | } | 1055 | } |
3531 | @@ -1058,7 +1062,7 @@ | |||
3532 | 1058 | } | 1062 | } |
3533 | 1059 | 1063 | ||
3534 | 1060 | private String getFileNameForCurrentWork() { | 1064 | private String getFileNameForCurrentWork() { |
3536 | 1061 | String fileName = ""; | 1065 | String fileName = TITLE_PLACEHOLDER; |
3537 | 1062 | if (editorInFocus != null) { | 1066 | if (editorInFocus != null) { |
3538 | 1063 | WorkspaceEntry we = editorInFocus.getWorkspaceEntry(); | 1067 | WorkspaceEntry we = editorInFocus.getWorkspaceEntry(); |
3539 | 1064 | if (we != null) { | 1068 | if (we != null) { |
3540 | @@ -1098,7 +1102,7 @@ | |||
3541 | 1098 | throw new RuntimeException("Cannot save workspace entry - it does not have an associated Workcraft model."); | 1102 | throw new RuntimeException("Cannot save workspace entry - it does not have an associated Workcraft model."); |
3542 | 1099 | } | 1103 | } |
3543 | 1100 | we.setChanged(false); | 1104 | we.setChanged(false); |
3545 | 1101 | refreshTitle(we); | 1105 | refreshWorkspaceEntryTitle(we, true); |
3546 | 1102 | lastSavePath = we.getFile().getParent(); | 1106 | lastSavePath = we.getFile().getParent(); |
3547 | 1103 | pushRecentFile(we.getFile().getPath(), true); | 1107 | pushRecentFile(we.getFile().getPath(), true); |
3548 | 1104 | } catch (SerialisationException e) { | 1108 | } catch (SerialisationException e) { |
3549 | @@ -1168,7 +1172,7 @@ | |||
3550 | 1168 | } | 1172 | } |
3551 | 1169 | 1173 | ||
3552 | 1170 | private String getTitle(WorkspaceEntry we, VisualModel model) { | 1174 | private String getTitle(WorkspaceEntry we, VisualModel model) { |
3554 | 1171 | String prefix = (we.isChanged() ? "*" : ""); | 1175 | String prefix = (we.isChanged() ? "*" : TITLE_PLACEHOLDER); |
3555 | 1172 | String suffix = null; | 1176 | String suffix = null; |
3556 | 1173 | switch (CommonEditorSettings.getTitleStyle()) { | 1177 | switch (CommonEditorSettings.getTitleStyle()) { |
3557 | 1174 | case LONG: | 1178 | case LONG: |
3558 | @@ -1178,25 +1182,34 @@ | |||
3559 | 1178 | suffix = " [" + model.getShortName() + "]"; | 1182 | suffix = " [" + model.getShortName() + "]"; |
3560 | 1179 | break; | 1183 | break; |
3561 | 1180 | default: | 1184 | default: |
3563 | 1181 | suffix = ""; | 1185 | suffix = TITLE_PLACEHOLDER; |
3564 | 1182 | break; | 1186 | break; |
3565 | 1183 | } | 1187 | } |
3566 | 1184 | return (prefix + we.getTitle() + suffix); | 1188 | return (prefix + we.getTitle() + suffix); |
3567 | 1185 | } | 1189 | } |
3570 | 1186 | 1190 | ||
3571 | 1187 | public void refreshTitle(WorkspaceEntry we) { | 1191 | public void refreshWorkspaceEntryTitle(WorkspaceEntry we, boolean updateHeaders) { |
3572 | 1188 | for (DockableWindow w : editorWindows.get(we)) { | 1192 | for (DockableWindow w : editorWindows.get(we)) { |
3573 | 1189 | final GraphEditorPanel editor = getCurrentEditor(); | 1193 | final GraphEditorPanel editor = getCurrentEditor(); |
3574 | 1190 | String title = getTitle(we, editor.getModel()); | 1194 | String title = getTitle(we, editor.getModel()); |
3579 | 1191 | w.getContentPanel().setTitle(title); | 1195 | w.setTitle(title); |
3580 | 1192 | w.setTabText(title); | 1196 | } |
3581 | 1193 | } | 1197 | if (updateHeaders) { |
3582 | 1194 | DockableWindow.updateHeaders(rootDockingPort,getDefaultActionListener()); | 1198 | DockableWindow.updateHeaders(rootDockingPort, getDefaultActionListener()); |
3583 | 1199 | } | ||
3584 | 1195 | } | 1200 | } |
3585 | 1196 | 1201 | ||
3587 | 1197 | public void refreshAllTitles() { | 1202 | public void refreshWorkspaceEntryTitles() { |
3588 | 1198 | for (WorkspaceEntry we : editorWindows.keySet()) { | 1203 | for (WorkspaceEntry we : editorWindows.keySet()) { |
3590 | 1199 | refreshTitle(we); | 1204 | refreshWorkspaceEntryTitle(we, false); |
3591 | 1205 | } | ||
3592 | 1206 | DockableWindow.updateHeaders(rootDockingPort, getDefaultActionListener()); | ||
3593 | 1207 | } | ||
3594 | 1208 | |||
3595 | 1209 | public void setDockableTitle(DockableWindow dockable, String title) { | ||
3596 | 1210 | if (dockable != null) { | ||
3597 | 1211 | dockable.setTitle(title); | ||
3598 | 1212 | DockableWindow.updateHeaders(rootDockingPort, getDefaultActionListener()); | ||
3599 | 1200 | } | 1213 | } |
3600 | 1201 | } | 1214 | } |
3601 | 1202 | 1215 | ||
3602 | @@ -1221,7 +1234,8 @@ | |||
3603 | 1221 | public void closeActiveEditor() throws OperationCancelledException { | 1234 | public void closeActiveEditor() throws OperationCancelledException { |
3604 | 1222 | for (WorkspaceEntry k : editorWindows.keySet()) { | 1235 | for (WorkspaceEntry k : editorWindows.keySet()) { |
3605 | 1223 | for (DockableWindow w : editorWindows.get(k)) { | 1236 | for (DockableWindow w : editorWindows.get(k)) { |
3607 | 1224 | if (w.getContentPanel().getContent() == editorInFocus) { | 1237 | DockableWindowContentPanel contentPanel = w.getContentPanel(); |
3608 | 1238 | if ((contentPanel != null) && (contentPanel.getContent() == editorInFocus)) { | ||
3609 | 1225 | closeDockableWindow(w); | 1239 | closeDockableWindow(w); |
3610 | 1226 | return; | 1240 | return; |
3611 | 1227 | } | 1241 | } |
3612 | @@ -1323,7 +1337,7 @@ | |||
3613 | 1323 | dlg.setModal(true); | 1337 | dlg.setModal(true); |
3614 | 1324 | dlg.setResizable(true); | 1338 | dlg.setResizable(true); |
3615 | 1325 | dlg.setVisible(true); | 1339 | dlg.setVisible(true); |
3617 | 1326 | refreshAllTitles(); | 1340 | refreshWorkspaceEntryTitles(); |
3618 | 1327 | } | 1341 | } |
3619 | 1328 | 1342 | ||
3620 | 1329 | public void resetLayout() { | 1343 | public void resetLayout() { |
3621 | 1330 | 1344 | ||
3622 | === modified file 'WorkcraftCore/src/org/workcraft/gui/MainWindowActions.java' | |||
3623 | --- WorkcraftCore/src/org/workcraft/gui/MainWindowActions.java 2015-01-26 22:10:33 +0000 | |||
3624 | +++ WorkcraftCore/src/org/workcraft/gui/MainWindowActions.java 2015-06-26 22:23:53 +0000 | |||
3625 | @@ -39,7 +39,10 @@ | |||
3626 | 39 | public static final Action SAVE_WORK_ACTION = new Action() { | 39 | public static final Action SAVE_WORK_ACTION = new Action() { |
3627 | 40 | @Override public void run() { | 40 | @Override public void run() { |
3628 | 41 | final Framework f = Framework.getInstance(); | 41 | final Framework f = Framework.getInstance(); |
3630 | 42 | try { f.getMainWindow().saveWork(); } catch (OperationCancelledException e) { } | 42 | try { |
3631 | 43 | f.getMainWindow().saveWork(); | ||
3632 | 44 | } catch (OperationCancelledException e) { | ||
3633 | 45 | } | ||
3634 | 43 | } | 46 | } |
3635 | 44 | @Override public String getText() { | 47 | @Override public String getText() { |
3636 | 45 | return "Save work"; | 48 | return "Save work"; |
3637 | @@ -48,7 +51,10 @@ | |||
3638 | 48 | public static final Action SAVE_WORK_AS_ACTION = new Action() { | 51 | public static final Action SAVE_WORK_AS_ACTION = new Action() { |
3639 | 49 | @Override public void run() { | 52 | @Override public void run() { |
3640 | 50 | final Framework f = Framework.getInstance(); | 53 | final Framework f = Framework.getInstance(); |
3642 | 51 | try { f.getMainWindow().saveWorkAs(); } catch (OperationCancelledException e) { } | 54 | try { |
3643 | 55 | f.getMainWindow().saveWorkAs(); | ||
3644 | 56 | } catch (OperationCancelledException e) { | ||
3645 | 57 | } | ||
3646 | 52 | } | 58 | } |
3647 | 53 | public String getText() { | 59 | public String getText() { |
3648 | 54 | return "Save work as..."; | 60 | return "Save work as..."; |
3649 | @@ -57,7 +63,10 @@ | |||
3650 | 57 | public static final Action CLOSE_ACTIVE_EDITOR_ACTION = new Action() { | 63 | public static final Action CLOSE_ACTIVE_EDITOR_ACTION = new Action() { |
3651 | 58 | @Override public void run() { | 64 | @Override public void run() { |
3652 | 59 | final Framework f = Framework.getInstance(); | 65 | final Framework f = Framework.getInstance(); |
3654 | 60 | try { f.getMainWindow().closeActiveEditor(); } catch (OperationCancelledException e) { } | 66 | try { |
3655 | 67 | f.getMainWindow().closeActiveEditor(); | ||
3656 | 68 | } catch (OperationCancelledException e) { | ||
3657 | 69 | } | ||
3658 | 61 | } | 70 | } |
3659 | 62 | public String getText() { | 71 | public String getText() { |
3660 | 63 | return "Close active work"; | 72 | return "Close active work"; |
3661 | @@ -67,7 +76,10 @@ | |||
3662 | 67 | public static final Action CLOSE_ALL_EDITORS_ACTION = new Action() { | 76 | public static final Action CLOSE_ALL_EDITORS_ACTION = new Action() { |
3663 | 68 | @Override public void run() { | 77 | @Override public void run() { |
3664 | 69 | final Framework f = Framework.getInstance(); | 78 | final Framework f = Framework.getInstance(); |
3666 | 70 | try { f.getMainWindow().closeEditorWindows(); } catch (OperationCancelledException e) { } | 79 | try { |
3667 | 80 | f.getMainWindow().closeEditorWindows(); | ||
3668 | 81 | } catch (OperationCancelledException e) { | ||
3669 | 82 | } | ||
3670 | 71 | } | 83 | } |
3671 | 72 | public String getText() { | 84 | public String getText() { |
3672 | 73 | return "Close all works"; | 85 | return "Close all works"; |
3673 | 74 | 86 | ||
3674 | === modified file 'WorkcraftCore/src/org/workcraft/gui/PropertyEditorWindow.java' | |||
3675 | --- WorkcraftCore/src/org/workcraft/gui/PropertyEditorWindow.java 2015-04-14 13:26:34 +0000 | |||
3676 | +++ WorkcraftCore/src/org/workcraft/gui/PropertyEditorWindow.java 2015-06-26 22:23:53 +0000 | |||
3677 | @@ -34,7 +34,7 @@ | |||
3678 | 34 | private PropertyEditorTable propertyTable; | 34 | private PropertyEditorTable propertyTable; |
3679 | 35 | private JScrollPane scrollProperties; | 35 | private JScrollPane scrollProperties; |
3680 | 36 | 36 | ||
3682 | 37 | public PropertyEditorWindow () { | 37 | public PropertyEditorWindow() { |
3683 | 38 | propertyTable = new PropertyEditorTable(); | 38 | propertyTable = new PropertyEditorTable(); |
3684 | 39 | 39 | ||
3685 | 40 | scrollProperties = new JScrollPane(); | 40 | scrollProperties = new JScrollPane(); |
3686 | @@ -45,19 +45,19 @@ | |||
3687 | 45 | validate(); | 45 | validate(); |
3688 | 46 | } | 46 | } |
3689 | 47 | 47 | ||
3691 | 48 | public Properties getObject () { | 48 | public Properties getObject() { |
3692 | 49 | return propertyTable.getObject(); | 49 | return propertyTable.getObject(); |
3693 | 50 | } | 50 | } |
3694 | 51 | 51 | ||
3696 | 52 | public void setObject (Properties o) { | 52 | public void setObject(Properties o) { |
3697 | 53 | removeAll(); | 53 | removeAll(); |
3699 | 54 | propertyTable.setObject(o); | 54 | propertyTable.setObject(o); |
3700 | 55 | add(scrollProperties, BorderLayout.CENTER); | 55 | add(scrollProperties, BorderLayout.CENTER); |
3701 | 56 | validate(); | 56 | validate(); |
3702 | 57 | repaint(); | 57 | repaint(); |
3703 | 58 | } | 58 | } |
3704 | 59 | 59 | ||
3706 | 60 | public void clearObject () { | 60 | public void clearObject() { |
3707 | 61 | if (propertyTable.getObject() != null) { | 61 | if (propertyTable.getObject() != null) { |
3708 | 62 | removeAll(); | 62 | removeAll(); |
3709 | 63 | propertyTable.clearObject(); | 63 | propertyTable.clearObject(); |
3710 | 64 | 64 | ||
3711 | === added file 'WorkcraftCore/src/org/workcraft/gui/SilverOceanTheme.java' | |||
3712 | --- WorkcraftCore/src/org/workcraft/gui/SilverOceanTheme.java 1970-01-01 00:00:00 +0000 | |||
3713 | +++ WorkcraftCore/src/org/workcraft/gui/SilverOceanTheme.java 2015-06-26 22:23:53 +0000 | |||
3714 | @@ -0,0 +1,132 @@ | |||
3715 | 1 | package org.workcraft.gui; | ||
3716 | 2 | |||
3717 | 3 | import java.awt.Font; | ||
3718 | 4 | import java.awt.Toolkit; | ||
3719 | 5 | import java.io.Serializable; | ||
3720 | 6 | import java.util.Arrays; | ||
3721 | 7 | import java.util.List; | ||
3722 | 8 | |||
3723 | 9 | import javax.swing.BorderFactory; | ||
3724 | 10 | import javax.swing.UIDefaults; | ||
3725 | 11 | import javax.swing.plaf.BorderUIResource; | ||
3726 | 12 | import javax.swing.plaf.ColorUIResource; | ||
3727 | 13 | import javax.swing.plaf.FontUIResource; | ||
3728 | 14 | import javax.swing.plaf.metal.MetalLookAndFeel; | ||
3729 | 15 | import javax.swing.plaf.metal.OceanTheme; | ||
3730 | 16 | |||
3731 | 17 | public class SilverOceanTheme extends OceanTheme { | ||
3732 | 18 | |||
3733 | 19 | private static final double FONT_SIZE = 11.0; | ||
3734 | 20 | private static final String FONT_NAME = "Verdana"; | ||
3735 | 21 | |||
3736 | 22 | public static void enable() { | ||
3737 | 23 | MetalLookAndFeel.setCurrentTheme(new SilverOceanTheme()); | ||
3738 | 24 | } | ||
3739 | 25 | |||
3740 | 26 | @Override | ||
3741 | 27 | public FontUIResource getControlTextFont() { | ||
3742 | 28 | int screenDpi = Toolkit.getDefaultToolkit().getScreenResolution(); | ||
3743 | 29 | int fontSizeInPixels = (int)Math.round(FONT_SIZE * screenDpi / 72.0); | ||
3744 | 30 | return new FontUIResource(FONT_NAME, Font.PLAIN, fontSizeInPixels); | ||
3745 | 31 | } | ||
3746 | 32 | |||
3747 | 33 | @Override | ||
3748 | 34 | public FontUIResource getMenuTextFont() { | ||
3749 | 35 | return getControlTextFont(); | ||
3750 | 36 | } | ||
3751 | 37 | |||
3752 | 38 | @Override | ||
3753 | 39 | public FontUIResource getSubTextFont() { | ||
3754 | 40 | return getControlTextFont(); | ||
3755 | 41 | } | ||
3756 | 42 | |||
3757 | 43 | @Override | ||
3758 | 44 | public FontUIResource getSystemTextFont() { | ||
3759 | 45 | return getControlTextFont(); | ||
3760 | 46 | } | ||
3761 | 47 | |||
3762 | 48 | @Override | ||
3763 | 49 | public FontUIResource getUserTextFont() { | ||
3764 | 50 | return getControlTextFont(); | ||
3765 | 51 | } | ||
3766 | 52 | |||
3767 | 53 | @Override | ||
3768 | 54 | public FontUIResource getWindowTitleFont() { | ||
3769 | 55 | return new FontUIResource(getControlTextFont().deriveFont(Font.BOLD)); | ||
3770 | 56 | } | ||
3771 | 57 | |||
3772 | 58 | @Override | ||
3773 | 59 | protected ColorUIResource getSecondary1() { | ||
3774 | 60 | return new ColorUIResource(0x999999); | ||
3775 | 61 | } | ||
3776 | 62 | |||
3777 | 63 | @Override | ||
3778 | 64 | protected ColorUIResource getSecondary2() { | ||
3779 | 65 | return new ColorUIResource(0xcccccc); | ||
3780 | 66 | } | ||
3781 | 67 | |||
3782 | 68 | @Override | ||
3783 | 69 | protected ColorUIResource getSecondary3() { | ||
3784 | 70 | return new ColorUIResource(0xeeeeee); | ||
3785 | 71 | } | ||
3786 | 72 | |||
3787 | 73 | @Override | ||
3788 | 74 | protected ColorUIResource getPrimary1() { | ||
3789 | 75 | return new ColorUIResource(0x999999); | ||
3790 | 76 | } | ||
3791 | 77 | |||
3792 | 78 | @Override | ||
3793 | 79 | protected ColorUIResource getPrimary2() { | ||
3794 | 80 | return new ColorUIResource(0xbbccdd); | ||
3795 | 81 | } | ||
3796 | 82 | |||
3797 | 83 | @Override | ||
3798 | 84 | protected ColorUIResource getPrimary3() { | ||
3799 | 85 | return new ColorUIResource(0xbbccdd); | ||
3800 | 86 | } | ||
3801 | 87 | |||
3802 | 88 | @Override | ||
3803 | 89 | public void addCustomEntriesToTable(UIDefaults table) { | ||
3804 | 90 | super.addCustomEntriesToTable(table); | ||
3805 | 91 | |||
3806 | 92 | List<Serializable> buttonGradient = Arrays.asList(1.0, 0.0, getSecondary3(), getSecondary2(), getSecondary2()); | ||
3807 | 93 | BorderUIResource menuItemBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 6, 3, 6)); | ||
3808 | 94 | |||
3809 | 95 | Object[] uiDefaults = { | ||
3810 | 96 | "Button.gradient", buttonGradient, | ||
3811 | 97 | "CheckBox.gradient", buttonGradient, | ||
3812 | 98 | "CheckBoxMenuItem.gradient", buttonGradient, | ||
3813 | 99 | "InternalFrame.activeTitleGradient", buttonGradient, | ||
3814 | 100 | "RadioButton.gradient", buttonGradient, | ||
3815 | 101 | "RadioButtonMenuItem.gradient", buttonGradient, | ||
3816 | 102 | "ScrollBar.gradient", buttonGradient, | ||
3817 | 103 | "Slider.focusGradient", buttonGradient, | ||
3818 | 104 | "Slider.gradient", buttonGradient, | ||
3819 | 105 | "ToggleButton.gradient", buttonGradient, | ||
3820 | 106 | |||
3821 | 107 | "TabbedPane.selected", getPrimary2(), | ||
3822 | 108 | "TabbedPane.contentAreaColor", getPrimary2(), | ||
3823 | 109 | |||
3824 | 110 | // "OptionPane.errorIcon", new IconUIResource(ImageLoader.loadIcon("ix")), | ||
3825 | 111 | // "OptionPane.informationIcon", new IconUIResource(ImageLoader.loadIcon("ii")), | ||
3826 | 112 | // "OptionPane.questionIcon", new IconUIResource(ImageLoader.loadIcon("iq")), | ||
3827 | 113 | // "OptionPane.warningIcon", new IconUIResource(ImageLoader.loadIcon("iw")), | ||
3828 | 114 | |||
3829 | 115 | "Menu.border", new BorderUIResource(BorderFactory.createEmptyBorder(3, 2, 3, 2)), | ||
3830 | 116 | "MenuItem.border", menuItemBorder, | ||
3831 | 117 | "CheckBoxMenuItem.border", menuItemBorder, | ||
3832 | 118 | "RadioButtonMenuItem.border", menuItemBorder, | ||
3833 | 119 | |||
3834 | 120 | "ComboBox.background", getWhite(), | ||
3835 | 121 | // "CheckBox.background", white, | ||
3836 | 122 | // "OptionPane.background", white, | ||
3837 | 123 | // "Panel.background", white, | ||
3838 | 124 | // "Slider.background", white, | ||
3839 | 125 | |||
3840 | 126 | // "TextField.background", new ColorUIResource(0xf4f4f4), | ||
3841 | 127 | "TextField.border", BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(getPrimary1()), BorderFactory.createEmptyBorder(4, 4, 4, 4)), | ||
3842 | 128 | }; | ||
3843 | 129 | table.putDefaults(uiDefaults); | ||
3844 | 130 | } | ||
3845 | 131 | |||
3846 | 132 | } | ||
3847 | 0 | 133 | ||
3848 | === modified file 'WorkcraftCore/src/org/workcraft/gui/graph/GraphEditorPanel.java' | |||
3849 | --- WorkcraftCore/src/org/workcraft/gui/graph/GraphEditorPanel.java 2015-04-23 22:59:53 +0000 | |||
3850 | +++ WorkcraftCore/src/org/workcraft/gui/graph/GraphEditorPanel.java 2015-06-26 22:23:53 +0000 | |||
3851 | @@ -38,7 +38,6 @@ | |||
3852 | 38 | import java.awt.event.KeyEvent; | 38 | import java.awt.event.KeyEvent; |
3853 | 39 | import java.awt.geom.AffineTransform; | 39 | import java.awt.geom.AffineTransform; |
3854 | 40 | import java.awt.geom.Point2D; | 40 | import java.awt.geom.Point2D; |
3855 | 41 | import java.io.OutputStream; | ||
3856 | 42 | import java.lang.reflect.InvocationTargetException; | 41 | import java.lang.reflect.InvocationTargetException; |
3857 | 43 | import java.util.ArrayList; | 42 | import java.util.ArrayList; |
3858 | 44 | import java.util.Collection; | 43 | import java.util.Collection; |
3859 | @@ -82,7 +81,11 @@ | |||
3860 | 82 | 81 | ||
3861 | 83 | public class GraphEditorPanel extends JPanel implements StateObserver, GraphEditor { | 82 | public class GraphEditorPanel extends JPanel implements StateObserver, GraphEditor { |
3862 | 84 | 83 | ||
3864 | 85 | public OutputStream backup; | 84 | |
3865 | 85 | public static final String TITLE_SUFFIX_TEMPLATE = "template"; | ||
3866 | 86 | public static final String TITLE_SUFFIX_MODEL = "model"; | ||
3867 | 87 | public static final String TITLE_SUFFIX_SINGLE_ELEMENT = "single element"; | ||
3868 | 88 | public static final String TITLE_SUFFIX_SELECTED_ELEMENTS = " selected elements"; | ||
3869 | 86 | 89 | ||
3870 | 87 | class Resizer implements ComponentListener { | 90 | class Resizer implements ComponentListener { |
3871 | 88 | 91 | ||
3872 | @@ -533,8 +536,7 @@ | |||
3873 | 533 | 536 | ||
3874 | 534 | public void updatePropertyView() { | 537 | public void updatePropertyView() { |
3875 | 535 | ModelProperties properties; | 538 | ModelProperties properties; |
3878 | 536 | String titlePrefix = "Property editor"; | 539 | String titleSuffix = null; |
3877 | 537 | String titleSuffix = ""; | ||
3879 | 538 | VisualNode templateNode = getModel().getTemplateNode(); | 540 | VisualNode templateNode = getModel().getTemplateNode(); |
3880 | 539 | if (templateNode != null) { | 541 | if (templateNode != null) { |
3881 | 540 | properties = getNodeProperties(templateNode); | 542 | properties = getNodeProperties(templateNode); |
3882 | @@ -543,36 +545,35 @@ | |||
3883 | 543 | properties.remove(pd); | 545 | properties.remove(pd); |
3884 | 544 | } | 546 | } |
3885 | 545 | } | 547 | } |
3887 | 546 | titlePrefix += " [template]"; | 548 | titleSuffix = TITLE_SUFFIX_TEMPLATE; |
3888 | 547 | } else { | 549 | } else { |
3889 | 548 | Collection<Node> selection = getModel().getSelection(); | 550 | Collection<Node> selection = getModel().getSelection(); |
3890 | 549 | if (selection.size() == 0) { | 551 | if (selection.size() == 0) { |
3891 | 550 | properties = getModelProperties(); | 552 | properties = getModelProperties(); |
3893 | 551 | titleSuffix += " [model]"; | 553 | titleSuffix = TITLE_SUFFIX_MODEL; |
3894 | 552 | } else if (selection.size() == 1) { | 554 | } else if (selection.size() == 1) { |
3895 | 553 | Node node = selection.iterator().next(); | 555 | Node node = selection.iterator().next(); |
3896 | 554 | properties = getNodeProperties(node); | 556 | properties = getNodeProperties(node); |
3898 | 555 | titleSuffix += " [single element]"; | 557 | titleSuffix = TITLE_SUFFIX_SINGLE_ELEMENT; |
3899 | 556 | } else { | 558 | } else { |
3900 | 557 | properties = getSelectionProperties(selection); | 559 | properties = getSelectionProperties(selection); |
3901 | 558 | int nodeCount = selection.size(); | 560 | int nodeCount = selection.size(); |
3903 | 559 | titleSuffix += " [" + nodeCount + " selected elements]"; | 561 | titleSuffix = nodeCount + " " + TITLE_SUFFIX_SELECTED_ELEMENTS; |
3904 | 560 | } | 562 | } |
3905 | 561 | } | 563 | } |
3906 | 562 | 564 | ||
3907 | 563 | final PropertyEditorWindow propertyEditorWindow = mainWindow.getPropertyView(); | 565 | final PropertyEditorWindow propertyEditorWindow = mainWindow.getPropertyView(); |
3908 | 564 | if(properties.getDescriptors().isEmpty()) { | 566 | if(properties.getDescriptors().isEmpty()) { |
3909 | 565 | propertyEditorWindow.clearObject(); | 567 | propertyEditorWindow.clearObject(); |
3910 | 566 | titleSuffix = ""; | ||
3911 | 567 | } else { | 568 | } else { |
3912 | 568 | propertyEditorWindow.setObject(propertiesWrapper(properties)); | 569 | propertyEditorWindow.setObject(propertiesWrapper(properties)); |
3913 | 569 | } | 570 | } |
3914 | 570 | 571 | ||
3920 | 571 | final DockableWindow propertyEditorDockable = mainWindow.getPropertyEditor(); | 572 | String title = MainWindow.TITLE_PROPERTY_EDITOR; |
3921 | 572 | String title = titlePrefix + titleSuffix; | 573 | if (titleSuffix != null) { |
3922 | 573 | propertyEditorDockable.getContentPanel().setTitle(title); | 574 | title += " [" + titleSuffix + "]"; |
3923 | 574 | propertyEditorDockable.setTabText(title); | 575 | } |
3924 | 575 | 576 | mainWindow.setDockableTitle(mainWindow.getPropertyEditor(), title); | |
3925 | 576 | updatePropertyViewRequested = false; | 577 | updatePropertyViewRequested = false; |
3926 | 577 | } | 578 | } |
3927 | 578 | 579 | ||
3928 | 579 | 580 | ||
3929 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/BooleanCellEditor.java' | |||
3930 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/BooleanCellEditor.java 2013-10-07 09:51:12 +0000 | |||
3931 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/BooleanCellEditor.java 2015-06-26 22:23:53 +0000 | |||
3932 | @@ -21,26 +21,26 @@ | |||
3933 | 21 | 21 | ||
3934 | 22 | package org.workcraft.gui.propertyeditor; | 22 | package org.workcraft.gui.propertyeditor; |
3935 | 23 | 23 | ||
3944 | 24 | import java.awt.Component; | 24 | import java.awt.Component; |
3945 | 25 | import java.awt.event.ItemEvent; | 25 | import java.awt.event.ItemEvent; |
3946 | 26 | import java.awt.event.ItemListener; | 26 | import java.awt.event.ItemListener; |
3947 | 27 | 27 | ||
3948 | 28 | import javax.swing.AbstractCellEditor; | 28 | import javax.swing.AbstractCellEditor; |
3949 | 29 | import javax.swing.JCheckBox; | 29 | import javax.swing.JCheckBox; |
3950 | 30 | import javax.swing.JTable; | 30 | import javax.swing.JTable; |
3951 | 31 | import javax.swing.table.TableCellEditor; | 31 | import javax.swing.table.TableCellEditor; |
3952 | 32 | 32 | ||
3953 | 33 | 33 | ||
3954 | 34 | @SuppressWarnings("serial") | 34 | @SuppressWarnings("serial") |
3957 | 35 | public class BooleanCellEditor extends AbstractCellEditor implements | 35 | public class BooleanCellEditor extends AbstractCellEditor implements TableCellEditor, ItemListener{ |
3956 | 36 | TableCellEditor, ItemListener{ | ||
3958 | 37 | 36 | ||
3959 | 38 | private JCheckBox checkBox; | 37 | private JCheckBox checkBox; |
3960 | 39 | 38 | ||
3961 | 40 | public BooleanCellEditor() { | 39 | public BooleanCellEditor() { |
3962 | 41 | checkBox = new JCheckBox(); | 40 | checkBox = new JCheckBox(); |
3963 | 42 | checkBox.setFocusable(false); | 41 | checkBox.setFocusable(false); |
3965 | 43 | checkBox.addItemListener(this); | 42 | checkBox.addItemListener(this); |
3966 | 43 | checkBox.setBorderPainted(false); | ||
3967 | 44 | } | 44 | } |
3968 | 45 | 45 | ||
3969 | 46 | public Component getTableCellEditorComponent( | 46 | public Component getTableCellEditorComponent( |
3970 | @@ -49,6 +49,7 @@ | |||
3971 | 49 | checkBox.setSelected((Boolean)value); | 49 | checkBox.setSelected((Boolean)value); |
3972 | 50 | } | 50 | } |
3973 | 51 | checkBox.setOpaque(value == null); | 51 | checkBox.setOpaque(value == null); |
3974 | 52 | checkBox.setFont(table.getFont()); | ||
3975 | 52 | return checkBox; | 53 | return checkBox; |
3976 | 53 | } | 54 | } |
3977 | 54 | 55 | ||
3978 | 55 | 56 | ||
3979 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/ChoiceCellEditor.java' | |||
3980 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/ChoiceCellEditor.java 2013-10-07 09:51:12 +0000 | |||
3981 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/ChoiceCellEditor.java 2015-06-26 22:23:53 +0000 | |||
3982 | @@ -26,6 +26,7 @@ | |||
3983 | 26 | import java.awt.event.ItemListener; | 26 | import java.awt.event.ItemListener; |
3984 | 27 | 27 | ||
3985 | 28 | import javax.swing.AbstractCellEditor; | 28 | import javax.swing.AbstractCellEditor; |
3986 | 29 | import javax.swing.BorderFactory; | ||
3987 | 29 | import javax.swing.JComboBox; | 30 | import javax.swing.JComboBox; |
3988 | 30 | import javax.swing.JTable; | 31 | import javax.swing.JTable; |
3989 | 31 | import javax.swing.table.TableCellEditor; | 32 | import javax.swing.table.TableCellEditor; |
3990 | @@ -40,7 +41,8 @@ | |||
3991 | 40 | comboBox = new JComboBox(); | 41 | comboBox = new JComboBox(); |
3992 | 41 | comboBox.setEditable(false); | 42 | comboBox.setEditable(false); |
3993 | 42 | comboBox.setFocusable(false); | 43 | comboBox.setFocusable(false); |
3995 | 43 | comboBox.addItemListener(this); | 44 | comboBox.addItemListener(this); |
3996 | 45 | comboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); | ||
3997 | 44 | 46 | ||
3998 | 45 | int declCount = decl.getChoice().size(); | 47 | int declCount = decl.getChoice().size(); |
3999 | 46 | wrappers = new ChoiceWrapper[declCount]; | 48 | wrappers = new ChoiceWrapper[declCount]; |
4000 | @@ -76,6 +78,7 @@ | |||
4001 | 76 | } | 78 | } |
4002 | 77 | } | 79 | } |
4003 | 78 | comboBox.setOpaque(value == null); | 80 | comboBox.setOpaque(value == null); |
4004 | 81 | comboBox.setFont(table.getFont()); | ||
4005 | 79 | return comboBox; | 82 | return comboBox; |
4006 | 80 | } | 83 | } |
4007 | 81 | 84 | ||
4008 | 82 | 85 | ||
4009 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellEditor.java' | |||
4010 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellEditor.java 2014-04-09 22:33:19 +0000 | |||
4011 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellEditor.java 2015-06-26 22:23:53 +0000 | |||
4012 | @@ -52,12 +52,12 @@ | |||
4013 | 52 | static JColorChooser chooser = null; | 52 | static JColorChooser chooser = null; |
4014 | 53 | static JDialog dialog = null; | 53 | static JDialog dialog = null; |
4015 | 54 | 54 | ||
4017 | 55 | protected static final String EDIT = "edit"; | 55 | protected static final String TAG_EDIT = "edit"; |
4018 | 56 | 56 | ||
4019 | 57 | public ColorCellEditor() { | 57 | public ColorCellEditor() { |
4020 | 58 | 58 | ||
4021 | 59 | button = new JButton(); | 59 | button = new JButton(); |
4023 | 60 | button.setActionCommand(EDIT); | 60 | button.setActionCommand(TAG_EDIT); |
4024 | 61 | button.addActionListener(this); | 61 | button.addActionListener(this); |
4025 | 62 | button.setBorderPainted(false); | 62 | button.setBorderPainted(false); |
4026 | 63 | button.setFocusable(false); | 63 | button.setFocusable(false); |
4027 | @@ -78,7 +78,7 @@ | |||
4028 | 78 | 78 | ||
4029 | 79 | @Override | 79 | @Override |
4030 | 80 | public void actionPerformed(ActionEvent e) { | 80 | public void actionPerformed(ActionEvent e) { |
4032 | 81 | if (EDIT.equals(e.getActionCommand())) { | 81 | if (TAG_EDIT.equals(e.getActionCommand())) { |
4033 | 82 | // The user has clicked the cell, so bring up the dialog. | 82 | // The user has clicked the cell, so bring up the dialog. |
4034 | 83 | approx.target = this; | 83 | approx.target = this; |
4035 | 84 | button.setBackground(color); | 84 | button.setBackground(color); |
4036 | @@ -86,7 +86,7 @@ | |||
4037 | 86 | dialog.setVisible(true); | 86 | dialog.setVisible(true); |
4038 | 87 | fireEditingStopped(); //Make the renderer reappear. | 87 | fireEditingStopped(); //Make the renderer reappear. |
4039 | 88 | } else { | 88 | } else { |
4041 | 89 | //User pressed dialog's "OK" button. | 89 | // User pressed dialog's "OK" button. |
4042 | 90 | color = chooser.getColor(); | 90 | color = chooser.getColor(); |
4043 | 91 | } | 91 | } |
4044 | 92 | } | 92 | } |
4045 | 93 | 93 | ||
4046 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellRenderer.java' | |||
4047 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellRenderer.java 2014-04-09 22:33:19 +0000 | |||
4048 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/ColorCellRenderer.java 2015-06-26 22:23:53 +0000 | |||
4049 | @@ -21,21 +21,17 @@ | |||
4050 | 21 | 21 | ||
4051 | 22 | package org.workcraft.gui.propertyeditor; | 22 | package org.workcraft.gui.propertyeditor; |
4052 | 23 | 23 | ||
4061 | 24 | import java.awt.Color; | 24 | import java.awt.Color; |
4062 | 25 | import java.awt.Component; | 25 | import java.awt.Component; |
4063 | 26 | 26 | ||
4064 | 27 | import javax.swing.BorderFactory; | 27 | import javax.swing.JLabel; |
4065 | 28 | import javax.swing.JLabel; | 28 | import javax.swing.JTable; |
4066 | 29 | import javax.swing.JTable; | 29 | import javax.swing.table.TableCellRenderer; |
4059 | 30 | import javax.swing.border.Border; | ||
4060 | 31 | import javax.swing.table.TableCellRenderer; | ||
4067 | 32 | 30 | ||
4068 | 33 | @SuppressWarnings("serial") | 31 | @SuppressWarnings("serial") |
4069 | 34 | public class ColorCellRenderer extends JLabel implements TableCellRenderer { | 32 | public class ColorCellRenderer extends JLabel implements TableCellRenderer { |
4074 | 35 | Border unselectedBorder = null; | 33 | |
4075 | 36 | Border selectedBorder = null; | 34 | public ColorCellRenderer() { |
4072 | 37 | |||
4073 | 38 | public ColorCellRenderer() { | ||
4076 | 39 | setOpaque(true); //MUST do this for background to show up. | 35 | setOpaque(true); //MUST do this for background to show up. |
4077 | 40 | setFocusable(false); | 36 | setFocusable(false); |
4078 | 41 | } | 37 | } |
4079 | @@ -43,22 +39,10 @@ | |||
4080 | 43 | @Override | 39 | @Override |
4081 | 44 | public Component getTableCellRendererComponent(JTable table, Object value, | 40 | public Component getTableCellRendererComponent(JTable table, Object value, |
4082 | 45 | boolean isSelected, boolean hasFocus, int row, int column) { | 41 | boolean isSelected, boolean hasFocus, int row, int column) { |
4083 | 42 | setBorder(PropertyEditorTable.BORDER_RENDER); | ||
4084 | 46 | if (value != null) { | 43 | if (value != null) { |
4085 | 47 | setBackground((Color)value); | 44 | setBackground((Color)value); |
4100 | 48 | if (isSelected) { | 45 | } |
4087 | 49 | if (selectedBorder == null) { | ||
4088 | 50 | selectedBorder = BorderFactory.createMatteBorder( | ||
4089 | 51 | 2, 5, 2, 5, table.getSelectionBackground()); | ||
4090 | 52 | } | ||
4091 | 53 | setBorder(selectedBorder); | ||
4092 | 54 | } else { | ||
4093 | 55 | if (unselectedBorder == null) { | ||
4094 | 56 | unselectedBorder = BorderFactory.createMatteBorder( | ||
4095 | 57 | 2, 5, 2, 5, table.getBackground()); | ||
4096 | 58 | } | ||
4097 | 59 | setBorder(unselectedBorder); | ||
4098 | 60 | } | ||
4099 | 61 | } | ||
4101 | 62 | return this; | 46 | return this; |
4102 | 63 | } | 47 | } |
4103 | 64 | } | ||
4104 | 65 | \ No newline at end of file | 48 | \ No newline at end of file |
4105 | 49 | } | ||
4106 | 66 | 50 | ||
4107 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/DefaultCellRenderer.java' | |||
4108 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/DefaultCellRenderer.java 2013-10-07 09:51:12 +0000 | |||
4109 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/DefaultCellRenderer.java 2015-06-26 22:23:53 +0000 | |||
4110 | @@ -13,12 +13,15 @@ | |||
4111 | 13 | public Component getTableCellRendererComponent(JTable table, Object value, | 13 | public Component getTableCellRendererComponent(JTable table, Object value, |
4112 | 14 | boolean isSelected, boolean hasFocus, int row, int column) { | 14 | boolean isSelected, boolean hasFocus, int row, int column) { |
4113 | 15 | if (value != null) { | 15 | if (value != null) { |
4115 | 16 | setText((String)value); | 16 | String text = value.toString(); |
4116 | 17 | setText(text); | ||
4117 | 18 | setFont(table.getFont()); | ||
4118 | 19 | setOpaque(text.isEmpty()); | ||
4119 | 17 | } else { | 20 | } else { |
4120 | 18 | setText(""); | 21 | setText(""); |
4121 | 22 | setOpaque(true); | ||
4122 | 19 | } | 23 | } |
4125 | 20 | setFont(table.getFont()); | 24 | setBorder(PropertyEditorTable.BORDER_RENDER); |
4124 | 21 | setOpaque(value == null || value.equals("")); | ||
4126 | 22 | return this; | 25 | return this; |
4127 | 23 | } | 26 | } |
4128 | 24 | 27 | ||
4129 | 25 | 28 | ||
4130 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/FileCellEditor.java' | |||
4131 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/FileCellEditor.java 2015-02-09 10:46:28 +0000 | |||
4132 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/FileCellEditor.java 2015-06-26 22:23:53 +0000 | |||
4133 | @@ -18,8 +18,8 @@ | |||
4134 | 18 | @SuppressWarnings("serial") | 18 | @SuppressWarnings("serial") |
4135 | 19 | public class FileCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener { | 19 | public class FileCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener { |
4136 | 20 | 20 | ||
4139 | 21 | protected static final String EDIT = "edit"; | 21 | protected static final String TAG_EDIT = "edit"; |
4140 | 22 | protected static final String CLEAR = "clear"; | 22 | protected static final String TAG_CLEAR = "clear"; |
4141 | 23 | 23 | ||
4142 | 24 | final private JPanel panel; | 24 | final private JPanel panel; |
4143 | 25 | final private JButton chooseButton; | 25 | final private JButton chooseButton; |
4144 | @@ -28,7 +28,7 @@ | |||
4145 | 28 | 28 | ||
4146 | 29 | public FileCellEditor() { | 29 | public FileCellEditor() { |
4147 | 30 | chooseButton = new JButton(); | 30 | chooseButton = new JButton(); |
4149 | 31 | chooseButton.setActionCommand(EDIT); | 31 | chooseButton.setActionCommand(TAG_EDIT); |
4150 | 32 | chooseButton.addActionListener(this); | 32 | chooseButton.addActionListener(this); |
4151 | 33 | chooseButton.setOpaque(true); | 33 | chooseButton.setOpaque(true); |
4152 | 34 | chooseButton.setBorderPainted(false); | 34 | chooseButton.setBorderPainted(false); |
4153 | @@ -37,7 +37,7 @@ | |||
4154 | 37 | chooseButton.setHorizontalAlignment(SwingConstants.LEFT); | 37 | chooseButton.setHorizontalAlignment(SwingConstants.LEFT); |
4155 | 38 | 38 | ||
4156 | 39 | clearButton = new JButton("x"); | 39 | clearButton = new JButton("x"); |
4158 | 40 | clearButton.setActionCommand(CLEAR); | 40 | clearButton.setActionCommand(TAG_CLEAR); |
4159 | 41 | clearButton.addActionListener(this); | 41 | clearButton.addActionListener(this); |
4160 | 42 | clearButton.setFocusable(false); | 42 | clearButton.setFocusable(false); |
4161 | 43 | clearButton.setMargin(new Insets(1, 1, 1, 1)); | 43 | clearButton.setMargin(new Insets(1, 1, 1, 1)); |
4162 | @@ -50,7 +50,7 @@ | |||
4163 | 50 | 50 | ||
4164 | 51 | @Override | 51 | @Override |
4165 | 52 | public void actionPerformed(ActionEvent e) { | 52 | public void actionPerformed(ActionEvent e) { |
4167 | 53 | if (EDIT.equals(e.getActionCommand())) { | 53 | if (TAG_EDIT.equals(e.getActionCommand())) { |
4168 | 54 | JFileChooser fc = new JFileChooser(); | 54 | JFileChooser fc = new JFileChooser(); |
4169 | 55 | fc.setDialogType(JFileChooser.OPEN_DIALOG); | 55 | fc.setDialogType(JFileChooser.OPEN_DIALOG); |
4170 | 56 | fc.setMultiSelectionEnabled(false); | 56 | fc.setMultiSelectionEnabled(false); |
4171 | @@ -59,7 +59,7 @@ | |||
4172 | 59 | if (fc.showDialog(null, "Open") == JFileChooser.APPROVE_OPTION) { | 59 | if (fc.showDialog(null, "Open") == JFileChooser.APPROVE_OPTION) { |
4173 | 60 | file = fc.getSelectedFile(); | 60 | file = fc.getSelectedFile(); |
4174 | 61 | } | 61 | } |
4176 | 62 | } else if (CLEAR.equals(e.getActionCommand())) { | 62 | } else if (TAG_CLEAR.equals(e.getActionCommand())) { |
4177 | 63 | file = null; | 63 | file = null; |
4178 | 64 | } | 64 | } |
4179 | 65 | fireEditingStopped(); | 65 | fireEditingStopped(); |
4180 | @@ -74,6 +74,7 @@ | |||
4181 | 74 | public Component getTableCellEditorComponent( | 74 | public Component getTableCellEditorComponent( |
4182 | 75 | JTable table, Object value, boolean isSelected, int row, int column) { | 75 | JTable table, Object value, boolean isSelected, int row, int column) { |
4183 | 76 | file = (File)value; | 76 | file = (File)value; |
4184 | 77 | panel.setFont(table.getFont()); | ||
4185 | 77 | return panel; | 78 | return panel; |
4186 | 78 | } | 79 | } |
4187 | 79 | 80 | ||
4188 | 80 | 81 | ||
4189 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/GenericCellEditor.java' | |||
4190 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/GenericCellEditor.java 2014-07-30 19:51:21 +0000 | |||
4191 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/GenericCellEditor.java 2015-06-26 22:23:53 +0000 | |||
4192 | @@ -37,6 +37,7 @@ | |||
4193 | 37 | public GenericCellEditor() { | 37 | public GenericCellEditor() { |
4194 | 38 | textField = new JTextField(); | 38 | textField = new JTextField(); |
4195 | 39 | textField.setFocusable(true); | 39 | textField.setFocusable(true); |
4196 | 40 | textField.setBorder(PropertyEditorTable.BORDER_EDIT); | ||
4197 | 40 | textField.addFocusListener(new FocusAdapter() { | 41 | textField.addFocusListener(new FocusAdapter() { |
4198 | 41 | @Override | 42 | @Override |
4199 | 42 | public void focusLost(FocusEvent e) { | 43 | public void focusLost(FocusEvent e) { |
4200 | @@ -50,8 +51,9 @@ | |||
4201 | 50 | } | 51 | } |
4202 | 51 | 52 | ||
4203 | 52 | public Component getTableCellEditorComponent(JTable table, Object value, | 53 | public Component getTableCellEditorComponent(JTable table, Object value, |
4206 | 53 | boolean isSelected, int row, int column) { | 54 | boolean isSelected, int row, int column) { |
4207 | 54 | textField.setText(value.toString()); | 55 | textField.setText(value.toString()); |
4208 | 56 | textField.setFont(table.getFont()); | ||
4209 | 55 | return textField; | 57 | return textField; |
4210 | 56 | } | 58 | } |
4211 | 57 | } | 59 | } |
4212 | 58 | 60 | ||
4213 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/ModelProperties.java' | |||
4214 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/ModelProperties.java 2015-01-12 22:28:11 +0000 | |||
4215 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/ModelProperties.java 2015-06-26 22:23:53 +0000 | |||
4216 | @@ -54,6 +54,19 @@ | |||
4217 | 54 | propertyDescriptors.addAll(descriptors); | 54 | propertyDescriptors.addAll(descriptors); |
4218 | 55 | } | 55 | } |
4219 | 56 | } | 56 | } |
4220 | 57 | |||
4221 | 58 | public void addSorted(final Collection<PropertyDescriptor> descriptors) { | ||
4222 | 59 | if (descriptors != null) { | ||
4223 | 60 | LinkedList<PropertyDescriptor> sortedDescriptors = new LinkedList<PropertyDescriptor>(descriptors); | ||
4224 | 61 | Collections.sort(sortedDescriptors, new Comparator<PropertyDescriptor>() { | ||
4225 | 62 | @Override | ||
4226 | 63 | public int compare(PropertyDescriptor o1, PropertyDescriptor o2) { | ||
4227 | 64 | return (o1.getName().compareTo(o2.getName())); | ||
4228 | 65 | } | ||
4229 | 66 | }); | ||
4230 | 67 | propertyDescriptors.addAll(sortedDescriptors); | ||
4231 | 68 | } | ||
4232 | 69 | } | ||
4233 | 57 | 70 | ||
4234 | 58 | public void remove(final PropertyDescriptor descriptor) { | 71 | public void remove(final PropertyDescriptor descriptor) { |
4235 | 59 | if (descriptor != null) { | 72 | if (descriptor != null) { |
4236 | @@ -75,14 +88,5 @@ | |||
4237 | 75 | public Collection<PropertyDescriptor> getDescriptors() { | 88 | public Collection<PropertyDescriptor> getDescriptors() { |
4238 | 76 | return Collections.unmodifiableList(propertyDescriptors); | 89 | return Collections.unmodifiableList(propertyDescriptors); |
4239 | 77 | } | 90 | } |
4240 | 78 | |||
4241 | 79 | public void sortByPropertyName() { | ||
4242 | 80 | Collections.sort(propertyDescriptors, new Comparator<PropertyDescriptor>() { | ||
4243 | 81 | @Override | ||
4244 | 82 | public int compare(PropertyDescriptor o1, PropertyDescriptor o2) { | ||
4245 | 83 | return (o1.getName().compareTo(o2.getName())); | ||
4246 | 84 | } | ||
4247 | 85 | }); | ||
4248 | 86 | } | ||
4249 | 87 | 91 | ||
4250 | 88 | } | 92 | } |
4251 | 89 | 93 | ||
4252 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/NamePropertyDescriptor.java' | |||
4253 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/NamePropertyDescriptor.java 2015-04-13 18:41:37 +0000 | |||
4254 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/NamePropertyDescriptor.java 2015-06-26 22:23:53 +0000 | |||
4255 | @@ -9,6 +9,8 @@ | |||
4256 | 9 | import org.workcraft.observation.PropertyChangedEvent; | 9 | import org.workcraft.observation.PropertyChangedEvent; |
4257 | 10 | 10 | ||
4258 | 11 | public class NamePropertyDescriptor implements PropertyDescriptor { | 11 | public class NamePropertyDescriptor implements PropertyDescriptor { |
4259 | 12 | public static final String PROPERTY_NAME = "Name"; | ||
4260 | 13 | |||
4261 | 12 | private final AbstractModel model; | 14 | private final AbstractModel model; |
4262 | 13 | private final Node node; | 15 | private final Node node; |
4263 | 14 | 16 | ||
4264 | @@ -26,7 +28,7 @@ | |||
4265 | 26 | public void setValue(Object value) throws InvocationTargetException { | 28 | public void setValue(Object value) throws InvocationTargetException { |
4266 | 27 | model.setName(node, (String)value); | 29 | model.setName(node, (String)value); |
4267 | 28 | if (node instanceof ObservableState) { | 30 | if (node instanceof ObservableState) { |
4269 | 29 | ((ObservableState)node).sendNotification(new PropertyChangedEvent(node, "name")); | 31 | ((ObservableState)node).sendNotification(new PropertyChangedEvent(node, PROPERTY_NAME)); |
4270 | 30 | } | 32 | } |
4271 | 31 | } | 33 | } |
4272 | 32 | 34 | ||
4273 | @@ -37,7 +39,7 @@ | |||
4274 | 37 | 39 | ||
4275 | 38 | @Override | 40 | @Override |
4276 | 39 | public String getName() { | 41 | public String getName() { |
4278 | 40 | return "Name"; | 42 | return PROPERTY_NAME; |
4279 | 41 | } | 43 | } |
4280 | 42 | 44 | ||
4281 | 43 | @Override | 45 | @Override |
4282 | 44 | 46 | ||
4283 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTable.java' | |||
4284 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTable.java 2015-05-22 17:42:39 +0000 | |||
4285 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTable.java 2015-06-26 22:23:53 +0000 | |||
4286 | @@ -22,21 +22,33 @@ | |||
4287 | 22 | package org.workcraft.gui.propertyeditor; | 22 | package org.workcraft.gui.propertyeditor; |
4288 | 23 | 23 | ||
4289 | 24 | import java.awt.Color; | 24 | import java.awt.Color; |
4290 | 25 | import java.awt.Component; | ||
4291 | 26 | import java.awt.Font; | ||
4292 | 27 | import java.awt.Graphics; | ||
4293 | 28 | import java.lang.reflect.InvocationTargetException; | ||
4294 | 25 | import java.net.URI; | 29 | import java.net.URI; |
4295 | 26 | import java.util.HashMap; | 30 | import java.util.HashMap; |
4296 | 27 | 31 | ||
4297 | 32 | import javax.swing.BorderFactory; | ||
4298 | 33 | import javax.swing.JLabel; | ||
4299 | 28 | import javax.swing.JOptionPane; | 34 | import javax.swing.JOptionPane; |
4300 | 29 | import javax.swing.JTable; | 35 | import javax.swing.JTable; |
4301 | 36 | import javax.swing.border.Border; | ||
4302 | 30 | import javax.swing.event.ChangeEvent; | 37 | import javax.swing.event.ChangeEvent; |
4303 | 31 | import javax.swing.table.DefaultTableCellRenderer; | 38 | import javax.swing.table.DefaultTableCellRenderer; |
4304 | 32 | import javax.swing.table.TableCellEditor; | 39 | import javax.swing.table.TableCellEditor; |
4305 | 33 | import javax.swing.table.TableCellRenderer; | 40 | import javax.swing.table.TableCellRenderer; |
4306 | 34 | 41 | ||
4307 | 35 | import org.workcraft.Framework; | 42 | import org.workcraft.Framework; |
4308 | 43 | import org.workcraft.PluginManager; | ||
4309 | 44 | import org.workcraft.dom.visual.FontHelper; | ||
4310 | 36 | import org.workcraft.plugins.PluginInfo; | 45 | import org.workcraft.plugins.PluginInfo; |
4311 | 37 | 46 | ||
4312 | 38 | @SuppressWarnings("serial") | 47 | @SuppressWarnings("serial") |
4313 | 39 | public class PropertyEditorTable extends JTable implements PropertyEditor { | 48 | public class PropertyEditorTable extends JTable implements PropertyEditor { |
4314 | 49 | public static final Border BORDER_RENDER = BorderFactory.createEmptyBorder(1, 3, 1, 1); | ||
4315 | 50 | public static final Border BORDER_EDIT = BorderFactory.createEmptyBorder(0, 3, 1, 1); | ||
4316 | 51 | |||
4317 | 40 | HashMap<Class<?>, PropertyClass> propertyClasses; | 52 | HashMap<Class<?>, PropertyClass> propertyClasses; |
4318 | 41 | TableCellRenderer cellRenderers[]; | 53 | TableCellRenderer cellRenderers[]; |
4319 | 42 | TableCellEditor cellEditors[]; | 54 | TableCellEditor cellEditors[]; |
4320 | @@ -46,11 +58,12 @@ | |||
4321 | 46 | super(); | 58 | super(); |
4322 | 47 | 59 | ||
4323 | 48 | model = new PropertyEditorTableModel(); | 60 | model = new PropertyEditorTableModel(); |
4326 | 49 | setModel(model); | 61 | setModel(model); |
4327 | 50 | 62 | ||
4328 | 51 | setTableHeader(null); | 63 | setTableHeader(null); |
4329 | 52 | setFocusable(false); | 64 | setFocusable(false); |
4331 | 53 | 65 | setRowHeight(FontHelper.getFontSizeInPixels(getFont())); | |
4332 | 66 | |||
4333 | 54 | propertyClasses = new HashMap<Class<?>, PropertyClass>(); | 67 | propertyClasses = new HashMap<Class<?>, PropertyClass>(); |
4334 | 55 | propertyClasses.put(int.class, new IntegerProperty()); | 68 | propertyClasses.put(int.class, new IntegerProperty()); |
4335 | 56 | propertyClasses.put(Integer.class, new IntegerProperty()); | 69 | propertyClasses.put(Integer.class, new IntegerProperty()); |
4336 | @@ -63,7 +76,8 @@ | |||
4337 | 63 | propertyClasses.put(URI.class, new FileProperty()); | 76 | propertyClasses.put(URI.class, new FileProperty()); |
4338 | 64 | 77 | ||
4339 | 65 | final Framework framework = Framework.getInstance(); | 78 | final Framework framework = Framework.getInstance(); |
4341 | 66 | for(PluginInfo<? extends PropertyClassProvider> plugin : framework.getPluginManager().getPlugins(PropertyClassProvider.class)) { | 79 | PluginManager pluginManager = framework.getPluginManager(); |
4342 | 80 | for(PluginInfo<? extends PropertyClassProvider> plugin : pluginManager.getPlugins(PropertyClassProvider.class)) { | ||
4343 | 67 | PropertyClassProvider instance = plugin.newInstance(); | 81 | PropertyClassProvider instance = plugin.newInstance(); |
4344 | 68 | propertyClasses.put(instance.getPropertyType(), instance.getPropertyGui()); | 82 | propertyClasses.put(instance.getPropertyType(), instance.getPropertyGui()); |
4345 | 69 | } | 83 | } |
4346 | @@ -71,18 +85,46 @@ | |||
4347 | 71 | 85 | ||
4348 | 72 | @Override | 86 | @Override |
4349 | 73 | public TableCellEditor getCellEditor(int row, int col) { | 87 | public TableCellEditor getCellEditor(int row, int col) { |
4351 | 74 | if (col == 0) | 88 | if (col == 0) { |
4352 | 75 | return super.getCellEditor(row, col); | 89 | return super.getCellEditor(row, col); |
4355 | 76 | else | 90 | } else { |
4356 | 77 | return cellEditors[row]; | 91 | return cellEditors[row]; |
4357 | 92 | } | ||
4358 | 78 | } | 93 | } |
4359 | 79 | 94 | ||
4360 | 80 | @Override | 95 | @Override |
4366 | 81 | public TableCellRenderer getCellRenderer(int row, int col) { | 96 | public TableCellRenderer getCellRenderer(int row, int col) { |
4367 | 82 | if (col == 0) | 97 | if (col > 0) { |
4368 | 83 | return super.getCellRenderer(row, col); | 98 | return cellRenderers[row]; |
4369 | 84 | else | 99 | } else { |
4370 | 85 | return cellRenderers[row]; | 100 | return new TableCellRenderer() { |
4371 | 101 | private final JLabel label = new JLabel() { | ||
4372 | 102 | @Override | ||
4373 | 103 | public void paint( Graphics g ) { | ||
4374 | 104 | g.setColor(getBackground()); | ||
4375 | 105 | g.fillRect(0, 0, getWidth() - 1, getHeight() - 1); | ||
4376 | 106 | super.paint(g); | ||
4377 | 107 | } | ||
4378 | 108 | }; | ||
4379 | 109 | |||
4380 | 110 | @Override | ||
4381 | 111 | public Component getTableCellRendererComponent(JTable table, Object value, | ||
4382 | 112 | boolean isSelected, boolean hasFocus, int row, int column) { | ||
4383 | 113 | label.setText(value.toString()); | ||
4384 | 114 | label.setBorder(BORDER_RENDER); | ||
4385 | 115 | PropertyDescriptor descriptor = model.getRowDeclaration(row); | ||
4386 | 116 | try { | ||
4387 | 117 | if (descriptor.getValue() == null) { | ||
4388 | 118 | Font boldFont = label.getFont().deriveFont(Font.BOLD); | ||
4389 | 119 | label.setFont(boldFont); | ||
4390 | 120 | } | ||
4391 | 121 | } catch (InvocationTargetException e) { | ||
4392 | 122 | } | ||
4393 | 123 | //label.setEnabled(false); | ||
4394 | 124 | return label; | ||
4395 | 125 | } | ||
4396 | 126 | }; | ||
4397 | 127 | } | ||
4398 | 86 | } | 128 | } |
4399 | 87 | 129 | ||
4400 | 88 | @Override | 130 | @Override |
4401 | @@ -93,11 +135,8 @@ | |||
4402 | 93 | @Override | 135 | @Override |
4403 | 94 | public void setObject(Properties o) { | 136 | public void setObject(Properties o) { |
4404 | 95 | model.setObject(o); | 137 | model.setObject(o); |
4405 | 96 | |||
4406 | 97 | cellRenderers = new TableCellRenderer[model.getRowCount()]; | 138 | cellRenderers = new TableCellRenderer[model.getRowCount()]; |
4407 | 98 | cellEditors = new TableCellEditor[model.getRowCount()]; | 139 | cellEditors = new TableCellEditor[model.getRowCount()]; |
4408 | 99 | |||
4409 | 100 | |||
4410 | 101 | for (int i = 0; i < model.getRowCount(); i++) { | 140 | for (int i = 0; i < model.getRowCount(); i++) { |
4411 | 102 | PropertyDescriptor decl = model.getRowDeclaration(i); | 141 | PropertyDescriptor decl = model.getRowDeclaration(i); |
4412 | 103 | 142 | ||
4413 | @@ -105,21 +144,19 @@ | |||
4414 | 105 | if (decl.getChoice() != null) { | 144 | if (decl.getChoice() != null) { |
4415 | 106 | model.setRowClass(i, null); | 145 | model.setRowClass(i, null); |
4416 | 107 | cellRenderers[i] = new DefaultCellRenderer(); | 146 | cellRenderers[i] = new DefaultCellRenderer(); |
4419 | 108 | ChoiceCellEditor ce = new ChoiceCellEditor(decl); | 147 | cellEditors[i] = new ChoiceCellEditor(decl); |
4418 | 109 | cellEditors[i] = ce; | ||
4420 | 110 | } else { | 148 | } else { |
4421 | 111 | // otherwise, try to get a corresponding PropertyClass object, that knows how to edit a property of this class | 149 | // otherwise, try to get a corresponding PropertyClass object, that knows how to edit a property of this class |
4422 | 112 | PropertyClass cls = propertyClasses.get(decl.getType()); | 150 | PropertyClass cls = propertyClasses.get(decl.getType()); |
4423 | 113 | model.setRowClass(i, cls); | 151 | model.setRowClass(i, cls); |
4425 | 114 | if (cls == null) { | 152 | if (cls != null) { |
4426 | 153 | cellRenderers[i] = cls.getCellRenderer(); | ||
4427 | 154 | cellEditors[i] = cls.getCellEditor(); | ||
4428 | 155 | } else { | ||
4429 | 115 | // no PropertyClass exists for this class, fall back to read-only mode using Object.toString() | 156 | // no PropertyClass exists for this class, fall back to read-only mode using Object.toString() |
4430 | 116 | System.err.println("Data class \"" + decl.getType().getName() + "\" is not supported by the Property Editor."); | 157 | System.err.println("Data class \"" + decl.getType().getName() + "\" is not supported by the Property Editor."); |
4433 | 117 | 158 | cellRenderers[i] = new DefaultTableCellRenderer(); | |
4432 | 118 | cellRenderers[i] = new DefaultTableCellRenderer(); | ||
4434 | 119 | cellEditors[i] = null; | 159 | cellEditors[i] = null; |
4435 | 120 | } else { | ||
4436 | 121 | cellRenderers[i] = cls.getCellRenderer(); | ||
4437 | 122 | cellEditors[i] = cls.getCellEditor(); | ||
4438 | 123 | } | 160 | } |
4439 | 124 | } | 161 | } |
4440 | 125 | } | 162 | } |
4441 | 126 | 163 | ||
4442 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTableModel.java' | |||
4443 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTableModel.java 2015-02-09 10:46:28 +0000 | |||
4444 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/PropertyEditorTableModel.java 2015-06-26 22:23:53 +0000 | |||
4445 | @@ -66,25 +66,28 @@ | |||
4446 | 66 | } | 66 | } |
4447 | 67 | 67 | ||
4448 | 68 | public int getColumnCount() { | 68 | public int getColumnCount() { |
4450 | 69 | if (object == null) | 69 | if (object == null) { |
4451 | 70 | return 0; | 70 | return 0; |
4454 | 71 | else | 71 | } else { |
4455 | 72 | return 2; | 72 | return 2; |
4456 | 73 | } | ||
4457 | 73 | } | 74 | } |
4458 | 74 | 75 | ||
4459 | 75 | public int getRowCount() { | 76 | public int getRowCount() { |
4461 | 76 | if (object == null) | 77 | if (object == null) { |
4462 | 77 | return 0; | 78 | return 0; |
4465 | 78 | else | 79 | } else { |
4466 | 79 | return declarations.length; | 80 | return declarations.length; |
4467 | 81 | } | ||
4468 | 80 | } | 82 | } |
4469 | 81 | 83 | ||
4470 | 82 | @Override | 84 | @Override |
4471 | 83 | public boolean isCellEditable(int row, int col) { | 85 | public boolean isCellEditable(int row, int col) { |
4473 | 84 | if (col == 0) | 86 | if (col == 0) { |
4474 | 85 | return false; | 87 | return false; |
4477 | 86 | else | 88 | } else { |
4478 | 87 | return (declarations[row].isWritable()); | 89 | return (declarations[row].isWritable()); |
4479 | 90 | } | ||
4480 | 88 | } | 91 | } |
4481 | 89 | 92 | ||
4482 | 90 | public PropertyDescriptor getRowDeclaration(int i) { | 93 | public PropertyDescriptor getRowDeclaration(int i) { |
4483 | @@ -92,26 +95,27 @@ | |||
4484 | 92 | } | 95 | } |
4485 | 93 | 96 | ||
4486 | 94 | public Object getValueAt(int row, int col) { | 97 | public Object getValueAt(int row, int col) { |
4488 | 95 | if (col ==0 ) | 98 | if (col == 0) { |
4489 | 96 | return declarations[row].getName(); | 99 | return declarations[row].getName(); |
4501 | 97 | else try { | 100 | } else { |
4502 | 98 | Object value = declarations[row].getValue(); | 101 | try { |
4503 | 99 | if (rowClasses[row] != null) | 102 | Object value = declarations[row].getValue(); |
4504 | 100 | return rowClasses[row].toCellRendererValue(value); | 103 | if (rowClasses[row] != null) { |
4505 | 101 | else | 104 | return rowClasses[row].toCellRendererValue(value); |
4506 | 102 | { | 105 | } else { |
4507 | 103 | Map<? extends Object, String> choice = declarations[row].getChoice(); | 106 | Map<? extends Object, String> choice = declarations[row].getChoice(); |
4508 | 104 | if(choice != null) | 107 | if(choice != null) { |
4509 | 105 | return choice.get(value); | 108 | return choice.get(value); |
4510 | 106 | else | 109 | } else { |
4511 | 107 | return value.toString(); | 110 | return value.toString(); |
4512 | 111 | } | ||
4513 | 112 | } | ||
4514 | 113 | } catch (Throwable e) { | ||
4515 | 114 | return "#EXCEPTION"; | ||
4516 | 108 | } | 115 | } |
4517 | 109 | } catch (Throwable e) { | ||
4518 | 110 | e.printStackTrace(); | ||
4519 | 111 | return "#EXCEPTION"; | ||
4520 | 112 | } | 116 | } |
4523 | 113 | } | 117 | } |
4524 | 114 | 118 | ||
4525 | 115 | @Override | 119 | @Override |
4526 | 116 | public void setValueAt(Object value, int row, int col) { | 120 | public void setValueAt(Object value, int row, int col) { |
4527 | 117 | PropertyDescriptor desc = declarations[row]; | 121 | PropertyDescriptor desc = declarations[row]; |
4528 | @@ -128,4 +132,5 @@ | |||
4529 | 128 | public Properties getObject() { | 132 | public Properties getObject() { |
4530 | 129 | return object; | 133 | return object; |
4531 | 130 | } | 134 | } |
4532 | 131 | } | ||
4533 | 132 | \ No newline at end of file | 135 | \ No newline at end of file |
4534 | 136 | |||
4535 | 137 | } | ||
4536 | 133 | 138 | ||
4537 | === modified file 'WorkcraftCore/src/org/workcraft/gui/propertyeditor/StringProperty.java' | |||
4538 | --- WorkcraftCore/src/org/workcraft/gui/propertyeditor/StringProperty.java 2014-04-09 22:33:19 +0000 | |||
4539 | +++ WorkcraftCore/src/org/workcraft/gui/propertyeditor/StringProperty.java 2015-06-26 22:23:53 +0000 | |||
4540 | @@ -45,7 +45,7 @@ | |||
4541 | 45 | public Object toCellRendererValue(Object value) { | 45 | public Object toCellRendererValue(Object value) { |
4542 | 46 | String result = ""; | 46 | String result = ""; |
4543 | 47 | if (value != null) { | 47 | if (value != null) { |
4545 | 48 | result = "" + value; | 48 | result = value.toString(); |
4546 | 49 | } | 49 | } |
4547 | 50 | return result; | 50 | return result; |
4548 | 51 | } | 51 | } |
4549 | 52 | 52 | ||
4550 | === modified file 'WorkcraftCore/src/org/workcraft/gui/trees/TreeWindow.java' | |||
4551 | --- WorkcraftCore/src/org/workcraft/gui/trees/TreeWindow.java 2015-02-10 15:21:12 +0000 | |||
4552 | +++ WorkcraftCore/src/org/workcraft/gui/trees/TreeWindow.java 2015-06-26 22:23:53 +0000 | |||
4553 | @@ -220,8 +220,9 @@ | |||
4554 | 220 | 220 | ||
4555 | 221 | String name = decorator.getName(node); | 221 | String name = decorator.getName(node); |
4556 | 222 | boolean tricky = name.startsWith("!"); | 222 | boolean tricky = name.startsWith("!"); |
4558 | 223 | if (tricky) | 223 | if (tricky) { |
4559 | 224 | name = name.substring(1); | 224 | name = name.substring(1); |
4560 | 225 | } | ||
4561 | 225 | Component res = super.getTreeCellRendererComponent(tree, name, sel, expanded, leaf, row, hasFocus); | 226 | Component res = super.getTreeCellRendererComponent(tree, name, sel, expanded, leaf, row, hasFocus); |
4562 | 226 | 227 | ||
4563 | 227 | 228 | ||
4564 | 228 | 229 | ||
4565 | === modified file 'WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java' | |||
4566 | --- WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java 2015-01-20 18:45:18 +0000 | |||
4567 | +++ WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java 2015-06-26 22:23:53 +0000 | |||
4568 | @@ -197,34 +197,29 @@ | |||
4569 | 197 | ListMap<String, Pair<String, Tool>> applicableTools = Tools.getTools(openFile); | 197 | ListMap<String, Pair<String, Tool>> applicableTools = Tools.getTools(openFile); |
4570 | 198 | List<String> sections = Tools.getSections(applicableTools); | 198 | List<String> sections = Tools.getSections(applicableTools); |
4571 | 199 | 199 | ||
4573 | 200 | if (!sections.isEmpty()) | 200 | if (!sections.isEmpty()) { |
4574 | 201 | popup.addSeparator(); | 201 | popup.addSeparator(); |
4576 | 202 | 202 | } | |
4577 | 203 | for (String section : sections) { | 203 | for (String section : sections) { |
4580 | 204 | JMenu m = new JMenu(section); | 204 | String menuName = (section.startsWith("!") ? section.substring(1) : section); |
4581 | 205 | 205 | JMenu menu = new JMenu(menuName); | |
4582 | 206 | for (Pair<String, Tool> tool : Tools.getSectionTools(section, applicableTools)) { | 206 | for (Pair<String, Tool> tool : Tools.getSectionTools(section, applicableTools)) { |
4587 | 207 | JMenuItem mi = new JMenuItem(tool.getFirst()); | 207 | JMenuItem item = new JMenuItem(tool.getFirst()); |
4588 | 208 | tools.put(mi, tool.getSecond()); | 208 | tools.put(item, tool.getSecond()); |
4589 | 209 | 209 | item.addActionListener(new ActionListener() { | |
4586 | 210 | mi.addActionListener(new ActionListener() { | ||
4590 | 211 | public void actionPerformed(ActionEvent e) { | 210 | public void actionPerformed(ActionEvent e) { |
4591 | 212 | Tools.run(openFile, tools.get(e.getSource())); | 211 | Tools.run(openFile, tools.get(e.getSource())); |
4592 | 213 | } | 212 | } |
4593 | 214 | }); | 213 | }); |
4596 | 215 | 214 | menu.add(item); | |
4595 | 216 | m.add(mi); | ||
4597 | 217 | } | 215 | } |
4600 | 218 | 216 | popup.add(menu); | |
4599 | 219 | popup.add(m); | ||
4601 | 220 | } | 217 | } |
4602 | 221 | } | 218 | } |
4603 | 222 | |||
4604 | 223 | popup.addSeparator(); | 219 | popup.addSeparator(); |
4605 | 224 | 220 | ||
4606 | 225 | JMenuItem miRemove = new JMenuItem("Delete"); | 221 | JMenuItem miRemove = new JMenuItem("Delete"); |
4609 | 226 | miRemove.addActionListener(new ActionListener() | 222 | miRemove.addActionListener(new ActionListener() { |
4608 | 227 | { | ||
4610 | 228 | public void actionPerformed(ActionEvent e) { | 223 | public void actionPerformed(ActionEvent e) { |
4611 | 229 | try { | 224 | try { |
4612 | 230 | workspace.delete(path); | 225 | workspace.delete(path); |
4613 | @@ -235,9 +230,11 @@ | |||
4614 | 235 | } | 230 | } |
4615 | 236 | 231 | ||
4616 | 237 | popup.addSeparator(); | 232 | popup.addSeparator(); |
4619 | 238 | if(path.isEmpty()) | 233 | if (path.isEmpty()) { |
4620 | 239 | for (Component c : wsWindow.createMenu().getMenuComponents()) | 234 | for (Component c : wsWindow.createMenu().getMenuComponents()) { |
4621 | 240 | popup.add(c); | 235 | popup.add(c); |
4622 | 236 | } | ||
4623 | 237 | } | ||
4624 | 241 | return popup; | 238 | return popup; |
4625 | 242 | } | 239 | } |
4626 | 243 | } | 240 | } |
4627 | 244 | \ No newline at end of file | 241 | \ No newline at end of file |
4628 | 245 | 242 | ||
4629 | === modified file 'WorkcraftCore/src/org/workcraft/serialisation/xml/XMLDeserialiserState.java' | |||
4630 | --- WorkcraftCore/src/org/workcraft/serialisation/xml/XMLDeserialiserState.java 2014-07-04 19:54:50 +0000 | |||
4631 | +++ WorkcraftCore/src/org/workcraft/serialisation/xml/XMLDeserialiserState.java 2015-06-26 22:23:53 +0000 | |||
4632 | @@ -77,7 +77,7 @@ | |||
4633 | 77 | 77 | ||
4634 | 78 | @Override | 78 | @Override |
4635 | 79 | public Object getObject(String reference) { | 79 | public Object getObject(String reference) { |
4637 | 80 | if (reference.equals("")) return null; | 80 | if (reference.isEmpty()) return null; |
4638 | 81 | 81 | ||
4639 | 82 | return internalReferenceMap.getValue(reference); | 82 | return internalReferenceMap.getValue(reference); |
4640 | 83 | } | 83 | } |
4641 | 84 | 84 | ||
4642 | === modified file 'WorkcraftCore/src/org/workcraft/util/Tools.java' | |||
4643 | --- WorkcraftCore/src/org/workcraft/util/Tools.java 2015-02-11 10:58:21 +0000 | |||
4644 | +++ WorkcraftCore/src/org/workcraft/util/Tools.java 2015-06-26 22:23:53 +0000 | |||
4645 | @@ -41,13 +41,13 @@ | |||
4646 | 41 | } | 41 | } |
4647 | 42 | } | 42 | } |
4648 | 43 | 43 | ||
4650 | 44 | public static List<String> getSections (ListMap<String, Pair<String, Tool>> tools) { | 44 | public static List<String> getSections(ListMap<String, Pair<String, Tool>> tools) { |
4651 | 45 | LinkedList<String> list = new LinkedList<String>(tools.keySet()); | 45 | LinkedList<String> list = new LinkedList<String>(tools.keySet()); |
4652 | 46 | Collections.sort(list); | 46 | Collections.sort(list); |
4653 | 47 | return list; | 47 | return list; |
4654 | 48 | } | 48 | } |
4655 | 49 | 49 | ||
4657 | 50 | public static List<Pair<String,Tool>> getSectionTools (String section, ListMap<String, Pair<String, Tool>> tools) { | 50 | public static List<Pair<String,Tool>> getSectionTools(String section, ListMap<String, Pair<String, Tool>> tools) { |
4658 | 51 | List<Pair<String,Tool>> sectionTools = new ArrayList<Pair<String, Tool>>(tools.get(section)); | 51 | List<Pair<String,Tool>> sectionTools = new ArrayList<Pair<String, Tool>>(tools.get(section)); |
4659 | 52 | 52 | ||
4660 | 53 | Collections.sort(sectionTools, new Comparator<Pair<String,Tool>>() { | 53 | Collections.sort(sectionTools, new Comparator<Pair<String,Tool>>() { |
4661 | 54 | 54 | ||
4662 | === modified file 'WorkcraftCore/src/org/workcraft/workspace/WorkspaceEntry.java' | |||
4663 | --- WorkcraftCore/src/org/workcraft/workspace/WorkspaceEntry.java 2015-05-19 18:01:37 +0000 | |||
4664 | +++ WorkcraftCore/src/org/workcraft/workspace/WorkspaceEntry.java 2015-06-26 22:23:53 +0000 | |||
4665 | @@ -75,7 +75,7 @@ | |||
4666 | 75 | } | 75 | } |
4667 | 76 | workspace.fireEntryChanged(this); | 76 | workspace.fireEntryChanged(this); |
4668 | 77 | final Framework framework = Framework.getInstance(); | 77 | final Framework framework = Framework.getInstance(); |
4670 | 78 | framework.getMainWindow().refreshTitle(this); | 78 | framework.getMainWindow().refreshWorkspaceEntryTitle(this, true); |
4671 | 79 | } | 79 | } |
4672 | 80 | } | 80 | } |
4673 | 81 | 81 | ||
4674 | @@ -199,7 +199,7 @@ | |||
4675 | 199 | MainWindowActions.EDIT_SELECT_NONE_ACTION.setEnabled(canModify && canSelect); | 199 | MainWindowActions.EDIT_SELECT_NONE_ACTION.setEnabled(canModify && canSelect); |
4676 | 200 | MainWindow mainWindow = Framework.getInstance().getMainWindow(); | 200 | MainWindow mainWindow = Framework.getInstance().getMainWindow(); |
4677 | 201 | if (mainWindow != null) { | 201 | if (mainWindow != null) { |
4679 | 202 | mainWindow.getMainMenu().getToolsMenu().setEnabled(canModify); | 202 | mainWindow.getMainMenu().updateToolsMenuState(canModify); |
4680 | 203 | } | 203 | } |
4681 | 204 | } | 204 | } |
4682 | 205 | 205 | ||
4683 | 206 | 206 | ||
4684 | === modified file 'XmasPlugin/src/org/workcraft/plugins/xmas/components/QueueComponent.java' | |||
4685 | --- XmasPlugin/src/org/workcraft/plugins/xmas/components/QueueComponent.java 2013-11-05 18:01:19 +0000 | |||
4686 | +++ XmasPlugin/src/org/workcraft/plugins/xmas/components/QueueComponent.java 2015-06-26 22:23:53 +0000 | |||
4687 | @@ -26,12 +26,13 @@ | |||
4688 | 26 | 26 | ||
4689 | 27 | @VisualClass(org.workcraft.plugins.xmas.components.VisualQueueComponent.class) | 27 | @VisualClass(org.workcraft.plugins.xmas.components.VisualQueueComponent.class) |
4690 | 28 | public class QueueComponent extends XmasComponent { | 28 | public class QueueComponent extends XmasComponent { |
4692 | 29 | 29 | public static final String PROPERTY_CAPACITY = "Capacity"; | |
4693 | 30 | |||
4694 | 30 | public int capacity = 0; | 31 | public int capacity = 0; |
4695 | 31 | 32 | ||
4696 | 32 | public void setCapacity(int capacity) { | 33 | public void setCapacity(int capacity) { |
4697 | 33 | this.capacity = capacity; | 34 | this.capacity = capacity; |
4699 | 34 | sendNotification(new PropertyChangedEvent(this, "capacity")); | 35 | sendNotification(new PropertyChangedEvent(this, PROPERTY_CAPACITY)); |
4700 | 35 | } | 36 | } |
4701 | 36 | 37 | ||
4702 | 37 | public int getCapacity() { | 38 | public int getCapacity() { |
4703 | 38 | 39 | ||
4704 | === modified file 'XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualQueueComponent.java' | |||
4705 | --- XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualQueueComponent.java 2015-04-13 18:41:37 +0000 | |||
4706 | +++ XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualQueueComponent.java 2015-06-26 22:23:53 +0000 | |||
4707 | @@ -41,6 +41,8 @@ | |||
4708 | 41 | @Hotkey(KeyEvent.VK_Q) | 41 | @Hotkey(KeyEvent.VK_Q) |
4709 | 42 | @SVGIcon("images/icons/svg/xmas-queue.svg") | 42 | @SVGIcon("images/icons/svg/xmas-queue.svg") |
4710 | 43 | public class VisualQueueComponent extends VisualXmasComponent { | 43 | public class VisualQueueComponent extends VisualXmasComponent { |
4711 | 44 | public static final String PROPERTY_FOREGROUND_COLOR = "Foreground color"; | ||
4712 | 45 | |||
4713 | 44 | public Color color = new Color(0, 0, 0, 255); | 46 | public Color color = new Color(0, 0, 0, 255); |
4714 | 45 | 47 | ||
4715 | 46 | public VisualQueueComponent(QueueComponent component) { | 48 | public VisualQueueComponent(QueueComponent component) { |
4716 | @@ -55,7 +57,7 @@ | |||
4717 | 55 | 57 | ||
4718 | 56 | private void addPropertyDeclarations() { | 58 | private void addPropertyDeclarations() { |
4719 | 57 | addPropertyDeclaration(new PropertyDeclaration<VisualQueueComponent, Integer>( | 59 | addPropertyDeclaration(new PropertyDeclaration<VisualQueueComponent, Integer>( |
4721 | 58 | this, "Capacity", Integer.class) { | 60 | this, QueueComponent.PROPERTY_CAPACITY, Integer.class) { |
4722 | 59 | public void setter(VisualQueueComponent object, Integer value) { | 61 | public void setter(VisualQueueComponent object, Integer value) { |
4723 | 60 | object.getReferencedQueueComponent().setCapacity(value); | 62 | object.getReferencedQueueComponent().setCapacity(value); |
4724 | 61 | } | 63 | } |
4725 | @@ -98,7 +100,7 @@ | |||
4726 | 98 | public void setColorRed() { | 100 | public void setColorRed() { |
4727 | 99 | this.color = new Color(255, 0, 0, 255); | 101 | this.color = new Color(255, 0, 0, 255); |
4728 | 100 | this.setForegroundColor(new Color(255, 0, 0, 255)); | 102 | this.setForegroundColor(new Color(255, 0, 0, 255)); |
4730 | 101 | sendNotification(new PropertyChangedEvent(this, "foregroundColor")); | 103 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FOREGROUND_COLOR)); |
4731 | 102 | } | 104 | } |
4732 | 103 | 105 | ||
4733 | 104 | @Override | 106 | @Override |
4734 | 105 | 107 | ||
4735 | === modified file 'XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualSourceComponent.java' | |||
4736 | --- XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualSourceComponent.java 2013-11-05 18:01:19 +0000 | |||
4737 | +++ XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualSourceComponent.java 2015-06-26 22:23:53 +0000 | |||
4738 | @@ -37,6 +37,8 @@ | |||
4739 | 37 | @Hotkey(KeyEvent.VK_I) | 37 | @Hotkey(KeyEvent.VK_I) |
4740 | 38 | @SVGIcon("images/icons/svg/xmas-source.svg") | 38 | @SVGIcon("images/icons/svg/xmas-source.svg") |
4741 | 39 | public class VisualSourceComponent extends VisualXmasComponent { | 39 | public class VisualSourceComponent extends VisualXmasComponent { |
4742 | 40 | public static final String PROPERTY_FOREGROUND_COLOR = "Foreground color"; | ||
4743 | 41 | |||
4744 | 40 | public Color color = new Color(0, 255, 0, 255); | 42 | public Color color = new Color(0, 255, 0, 255); |
4745 | 41 | 43 | ||
4746 | 42 | public VisualSourceComponent(SourceComponent component) { | 44 | public VisualSourceComponent(SourceComponent component) { |
4747 | @@ -49,7 +51,7 @@ | |||
4748 | 49 | public void setColorRed() { | 51 | public void setColorRed() { |
4749 | 50 | this.color = new Color(255, 0, 0, 255); | 52 | this.color = new Color(255, 0, 0, 255); |
4750 | 51 | this.setForegroundColor(new Color(255, 0, 0, 255)); | 53 | this.setForegroundColor(new Color(255, 0, 0, 255)); |
4752 | 52 | sendNotification(new PropertyChangedEvent(this, "foregroundColor")); | 54 | sendNotification(new PropertyChangedEvent(this, PROPERTY_FOREGROUND_COLOR)); |
4753 | 53 | } | 55 | } |
4754 | 54 | 56 | ||
4755 | 55 | @Override | 57 | @Override |
4756 | 56 | 58 | ||
4757 | === modified file 'XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasContact.java' | |||
4758 | --- XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasContact.java 2015-04-13 18:41:37 +0000 | |||
4759 | +++ XmasPlugin/src/org/workcraft/plugins/xmas/components/VisualXmasContact.java 2015-06-26 22:23:53 +0000 | |||
4760 | @@ -41,6 +41,8 @@ | |||
4761 | 41 | 41 | ||
4762 | 42 | 42 | ||
4763 | 43 | public class VisualXmasContact extends VisualComponent implements StateObserver { | 43 | public class VisualXmasContact extends VisualComponent implements StateObserver { |
4764 | 44 | public static final String IO_TYPE_PROPERTY_NAME = "IOtype"; | ||
4765 | 45 | |||
4766 | 44 | private double size = 0.4; | 46 | private double size = 0.4; |
4767 | 45 | 47 | ||
4768 | 46 | public VisualXmasContact(XmasContact contact) { | 48 | public VisualXmasContact(XmasContact contact) { |
4769 | @@ -70,7 +72,7 @@ | |||
4770 | 70 | 72 | ||
4771 | 71 | public void setIOType(XmasContact.IOType type) { | 73 | public void setIOType(XmasContact.IOType type) { |
4772 | 72 | getReferencedContact().setIOType(type); | 74 | getReferencedContact().setIOType(type); |
4774 | 73 | sendNotification(new PropertyChangedEvent(this, "IOtype")); | 75 | sendNotification(new PropertyChangedEvent(this, IO_TYPE_PROPERTY_NAME)); |
4775 | 74 | } | 76 | } |
4776 | 75 | 77 | ||
4777 | 76 | public XmasContact.IOType getIOType() { | 78 | public XmasContact.IOType getIOType() { |