]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.proconf.processeditor/src/org/simantics/processeditor/stubs/Plant3DResource.java
0280a4caedd2af71f6ff178429c7c94c76cea5ff
[simantics/3d.git] / org.simantics.proconf.processeditor / src / org / simantics / processeditor / stubs / Plant3DResource.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the terms of the Eclipse Public License v1.0\r
5  * which accompanies this distribution, and is available at\r
6  * http://www.eclipse.org/legal/epl-v10.html\r
7  *\r
8  * Contributors:\r
9  *     VTT Technical Research Centre of Finland - initial API and implementation\r
10  *******************************************************************************/\r
11 package org.simantics.processeditor.stubs;\r
12 \r
13 \r
14 import org.simantics.db.Resource;\r
15 import org.simantics.db.Graph;\r
16 import org.simantics.db.Session;\r
17 import org.simantics.db.exceptions.Layer0MissingException;\r
18 import org.simantics.db.exceptions.ResourceNotFoundException;\r
19 \r
20 public class Plant3DResource {\r
21     \r
22     public final Resource BranchControlPoint;\r
23     public final Resource BranchEndControlPoint;\r
24     public final Resource BranchSplitComponent;\r
25     public final Resource CodedComponent;\r
26     public final Resource ConcentricReducer;\r
27     public final Resource ControlPointOf;\r
28     public final Resource ControlPointOfPipeRun;\r
29     public final Resource DirectedControlPoint;\r
30     public final Resource DualConnectedComponent;\r
31     public final Resource DualInlineControlPoint;\r
32     public final Resource DualSubControlPoint;\r
33     public final Resource EccentricReducer;\r
34     public final Resource Elbow;\r
35     public final Resource EndComponent;\r
36     public final Resource EndComponentControlPoint;\r
37     public final Resource Equipment;\r
38     public final Resource FixedAngleTurnComponent;\r
39     public final Resource FixedAngleTurnControlPoint;\r
40     public final Resource FixedLengthControlPoint;\r
41     public final Resource FixedLengthInlineComponent;\r
42     public final Resource HasChildStructure;\r
43     public final Resource HasControlPoint;\r
44     public final Resource HasControlPoints;\r
45     public final Resource HasGraphics;\r
46     public final Resource HasHeight;\r
47     public final Resource HasLength;\r
48     public final Resource HasNext;\r
49     public final Resource HasNozzle;\r
50     public final Resource HasNozzleDefinition;\r
51     public final Resource HasNozzleRestriction;\r
52     public final Resource HasOffset;\r
53     public final Resource HasParentStructure;\r
54     public final Resource HasPipeDiameter;\r
55     public final Resource HasPrevious;\r
56     public final Resource HasRotationAngle;\r
57     public final Resource HasSubPoint;\r
58     public final Resource HasTurnAngle;\r
59     public final Resource HasTurnAxis;\r
60     public final Resource HasTurnRadius;\r
61     public final Resource HorizontalVessel;\r
62     public final Resource InlineComponent;\r
63     public final Resource InlineControlPoint;\r
64     public final Resource IsReversed;\r
65     public final Resource LibraryComponent;\r
66     public final Resource MultiConnectedComponent;\r
67     public final Resource NPortControlPoint;\r
68     public final Resource NonVisibleComponent;\r
69     public final Resource Nozzle;\r
70     public final Resource NozzleControlPoint;\r
71     public final Resource NozzleOf;\r
72     public final Resource OffsetComponent;\r
73     public final Resource OffsettingPoint;\r
74     public final Resource P3DNode;\r
75     public final Resource PBSNode;\r
76     public final Resource PathLegEndControlPoint;\r
77     public final Resource PipeControlPoint;\r
78     public final Resource PipeRun;\r
79     public final Resource PipelineComponent;\r
80     public final Resource Plant;\r
81     public final Resource Plant3DProjectType;\r
82     public final Resource Reducer;\r
83     public final Resource RunEndControlPoint;\r
84     public final Resource SingleConnectedComponent;\r
85     public final Resource SizeChangeComponent;\r
86     public final Resource SizeChangeControlPoint;\r
87     public final Resource Straight;\r
88     public final Resource SubPointOf;\r
89     public final Resource TurnComponent;\r
90     public final Resource TurnControlPoint;\r
91     public final Resource UndirectedControlPoint;\r
92     public final Resource VariableAngleTurnComponent;\r
93     public final Resource VariableAngleTurnControlPoint;\r
94     public final Resource VariableLengthControlPoint;\r
95     public final Resource VariableLengthInlineComponent;\r
96     public final Resource VerticalVessel;\r
97     public final Resource Vessel;\r
98     \r
99     public static class URIs {\r
100         public static final String BranchControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#BranchControlPoint";\r
101         public static final String BranchEndControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#BranchEndControlPoint";\r
102         public static final String BranchSplitComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0#BranchSplitComponent";\r
103         public static final String CodedComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#CodedComponent";\r
104         public static final String ConcentricReducer = "http://www.vtt.fi/Simantics/Plant3D/1.0#ConcentricReducer";\r
105         public static final String ControlPointOf = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#ControlPointOf";\r
106         public static final String ControlPointOfPipeRun = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#ControlPointOfPipeRun";\r
107         public static final String DirectedControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#DirectedControlPoint";\r
108         public static final String DualConnectedComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#DualConnectedComponent";\r
109         public static final String DualInlineControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#DualInlineControlPoint";\r
110         public static final String DualSubControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#DualSubControlPoint";\r
111         public static final String EccentricReducer = "http://www.vtt.fi/Simantics/Plant3D/1.0#EccentricReducer";\r
112         public static final String Elbow = "http://www.vtt.fi/Simantics/Plant3D/1.0#Elbow";\r
113         public static final String EndComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#EndComponent";\r
114         public static final String EndComponentControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#EndComponentControlPoint";\r
115         public static final String Equipment = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Equipment";\r
116         public static final String FixedAngleTurnComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#FixedAngleTurnComponent";\r
117         public static final String FixedAngleTurnControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#FixedAngleTurnControlPoint";\r
118         public static final String FixedLengthControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#FixedLengthControlPoint";\r
119         public static final String FixedLengthInlineComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#FixedLengthInlineComponent";\r
120         public static final String HasChildStructure = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasChildStructure";\r
121         public static final String HasControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasControlPoint";\r
122         public static final String HasControlPoints = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasControlPoints";\r
123         public static final String HasGraphics = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasGraphics";\r
124         public static final String HasHeight = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasHeight";\r
125         public static final String HasLength = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasLength";\r
126         public static final String HasNext = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasNext";\r
127         public static final String HasNozzle = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasNozzle";\r
128         public static final String HasNozzleDefinition = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasNozzleDefinition";\r
129         public static final String HasNozzleRestriction = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasNozzleRestriction";\r
130         public static final String HasOffset = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasOffset";\r
131         public static final String HasParentStructure = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasParentStructure";\r
132         public static final String HasPipeDiameter = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasPipeDiameter";\r
133         public static final String HasPrevious = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasPrevious";\r
134         public static final String HasRotationAngle = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasRotationAngle";\r
135         public static final String HasSubPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasSubPoint";\r
136         public static final String HasTurnAngle = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasTurnAngle";\r
137         public static final String HasTurnAxis = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasTurnAxis";\r
138         public static final String HasTurnRadius = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#HasTurnRadius";\r
139         public static final String HorizontalVessel = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#HorizontalVessel";\r
140         public static final String InlineComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#InlineComponent";\r
141         public static final String InlineControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#InlineControlPoint";\r
142         public static final String IsReversed = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#IsReversed";\r
143         public static final String LibraryComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#LibraryComponent";\r
144         public static final String MultiConnectedComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#MultiConnectedComponent";\r
145         public static final String NPortControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#NPortControlPoint";\r
146         public static final String NonVisibleComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#NonVisibleComponent";\r
147         public static final String Nozzle = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Nozzle";\r
148         public static final String NozzleControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#NozzleControlPoint";\r
149         public static final String NozzleOf = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#NozzleOf";\r
150         public static final String OffsetComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#OffsetComponent";\r
151         public static final String OffsettingPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#OffsettingPoint";\r
152         public static final String P3DNode = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#P3DNode";\r
153         public static final String PBSNode = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#PBSNode";\r
154         public static final String PathLegEndControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#PathLegEndControlPoint";\r
155         public static final String PipeControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#PipeControlPoint";\r
156         public static final String PipeRun = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#PipeRun";\r
157         public static final String PipelineComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#PipelineComponent";\r
158         public static final String Plant = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Plant";\r
159         public static final String Plant3DProjectType = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Plant3DProjectType";\r
160         public static final String Reducer = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Reducer";\r
161         public static final String RunEndControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#RunEndControlPoint";\r
162         public static final String SingleConnectedComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#SingleConnectedComponent";\r
163         public static final String SizeChangeComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#SizeChangeComponent";\r
164         public static final String SizeChangeControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#SizeChangeControlPoint";\r
165         public static final String Straight = "http://www.vtt.fi/Simantics/Plant3D/1.0#Straight";\r
166         public static final String SubPointOf = "http://www.vtt.fi/Simantics/Plant3D/1.0/Relations#SubPointOf";\r
167         public static final String TurnComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#TurnComponent";\r
168         public static final String TurnControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#TurnControlPoint";\r
169         public static final String UndirectedControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#UndirectedControlPoint";\r
170         public static final String VariableAngleTurnComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#VariableAngleTurnComponent";\r
171         public static final String VariableAngleTurnControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#VariableAngleTurnControlPoint";\r
172         public static final String VariableLengthControlPoint = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#VariableLengthControlPoint";\r
173         public static final String VariableLengthInlineComponent = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#VariableLengthInlineComponent";\r
174         public static final String VerticalVessel = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#VerticalVessel";\r
175         public static final String Vessel = "http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Vessel";\r
176     }\r
177     \r
178     public Plant3DResource(Graph graph) throws Layer0MissingException {\r
179         try {\r
180             BranchControlPoint = graph.getResourceByURI(URIs.BranchControlPoint);\r
181             BranchEndControlPoint = graph.getResourceByURI(URIs.BranchEndControlPoint);\r
182             BranchSplitComponent = graph.getResourceByURI(URIs.BranchSplitComponent);\r
183             CodedComponent = graph.getResourceByURI(URIs.CodedComponent);\r
184             ConcentricReducer = graph.getResourceByURI(URIs.ConcentricReducer);\r
185             ControlPointOf = graph.getResourceByURI(URIs.ControlPointOf);\r
186             ControlPointOfPipeRun = graph.getResourceByURI(URIs.ControlPointOfPipeRun);\r
187             DirectedControlPoint = graph.getResourceByURI(URIs.DirectedControlPoint);\r
188             DualConnectedComponent = graph.getResourceByURI(URIs.DualConnectedComponent);\r
189             DualInlineControlPoint = graph.getResourceByURI(URIs.DualInlineControlPoint);\r
190             DualSubControlPoint = graph.getResourceByURI(URIs.DualSubControlPoint);\r
191             EccentricReducer = graph.getResourceByURI(URIs.EccentricReducer);\r
192             Elbow = graph.getResourceByURI(URIs.Elbow);\r
193             EndComponent = graph.getResourceByURI(URIs.EndComponent);\r
194             EndComponentControlPoint = graph.getResourceByURI(URIs.EndComponentControlPoint);\r
195             Equipment = graph.getResourceByURI(URIs.Equipment);\r
196             FixedAngleTurnComponent = graph.getResourceByURI(URIs.FixedAngleTurnComponent);\r
197             FixedAngleTurnControlPoint = graph.getResourceByURI(URIs.FixedAngleTurnControlPoint);\r
198             FixedLengthControlPoint = graph.getResourceByURI(URIs.FixedLengthControlPoint);\r
199             FixedLengthInlineComponent = graph.getResourceByURI(URIs.FixedLengthInlineComponent);\r
200             HasChildStructure = graph.getResourceByURI(URIs.HasChildStructure);\r
201             HasControlPoint = graph.getResourceByURI(URIs.HasControlPoint);\r
202             HasControlPoints = graph.getResourceByURI(URIs.HasControlPoints);\r
203             HasGraphics = graph.getResourceByURI(URIs.HasGraphics);\r
204             HasHeight = graph.getResourceByURI(URIs.HasHeight);\r
205             HasLength = graph.getResourceByURI(URIs.HasLength);\r
206             HasNext = graph.getResourceByURI(URIs.HasNext);\r
207             HasNozzle = graph.getResourceByURI(URIs.HasNozzle);\r
208             HasNozzleDefinition = graph.getResourceByURI(URIs.HasNozzleDefinition);\r
209             HasNozzleRestriction = graph.getResourceByURI(URIs.HasNozzleRestriction);\r
210             HasOffset = graph.getResourceByURI(URIs.HasOffset);\r
211             HasParentStructure = graph.getResourceByURI(URIs.HasParentStructure);\r
212             HasPipeDiameter = graph.getResourceByURI(URIs.HasPipeDiameter);\r
213             HasPrevious = graph.getResourceByURI(URIs.HasPrevious);\r
214             HasRotationAngle = graph.getResourceByURI(URIs.HasRotationAngle);\r
215             HasSubPoint = graph.getResourceByURI(URIs.HasSubPoint);\r
216             HasTurnAngle = graph.getResourceByURI(URIs.HasTurnAngle);\r
217             HasTurnAxis = graph.getResourceByURI(URIs.HasTurnAxis);\r
218             HasTurnRadius = graph.getResourceByURI(URIs.HasTurnRadius);\r
219             HorizontalVessel = graph.getResourceByURI(URIs.HorizontalVessel);\r
220             InlineComponent = graph.getResourceByURI(URIs.InlineComponent);\r
221             InlineControlPoint = graph.getResourceByURI(URIs.InlineControlPoint);\r
222             IsReversed = graph.getResourceByURI(URIs.IsReversed);\r
223             LibraryComponent = graph.getResourceByURI(URIs.LibraryComponent);\r
224             MultiConnectedComponent = graph.getResourceByURI(URIs.MultiConnectedComponent);\r
225             NPortControlPoint = graph.getResourceByURI(URIs.NPortControlPoint);\r
226             NonVisibleComponent = graph.getResourceByURI(URIs.NonVisibleComponent);\r
227             Nozzle = graph.getResourceByURI(URIs.Nozzle);\r
228             NozzleControlPoint = graph.getResourceByURI(URIs.NozzleControlPoint);\r
229             NozzleOf = graph.getResourceByURI(URIs.NozzleOf);\r
230             OffsetComponent = graph.getResourceByURI(URIs.OffsetComponent);\r
231             OffsettingPoint = graph.getResourceByURI(URIs.OffsettingPoint);\r
232             P3DNode = graph.getResourceByURI(URIs.P3DNode);\r
233             PBSNode = graph.getResourceByURI(URIs.PBSNode);\r
234             PathLegEndControlPoint = graph.getResourceByURI(URIs.PathLegEndControlPoint);\r
235             PipeControlPoint = graph.getResourceByURI(URIs.PipeControlPoint);\r
236             PipeRun = graph.getResourceByURI(URIs.PipeRun);\r
237             PipelineComponent = graph.getResourceByURI(URIs.PipelineComponent);\r
238             Plant = graph.getResourceByURI(URIs.Plant);\r
239             Plant3DProjectType = graph.getResourceByURI(URIs.Plant3DProjectType);\r
240             Reducer = graph.getResourceByURI(URIs.Reducer);\r
241             RunEndControlPoint = graph.getResourceByURI(URIs.RunEndControlPoint);\r
242             SingleConnectedComponent = graph.getResourceByURI(URIs.SingleConnectedComponent);\r
243             SizeChangeComponent = graph.getResourceByURI(URIs.SizeChangeComponent);\r
244             SizeChangeControlPoint = graph.getResourceByURI(URIs.SizeChangeControlPoint);\r
245             Straight = graph.getResourceByURI(URIs.Straight);\r
246             SubPointOf = graph.getResourceByURI(URIs.SubPointOf);\r
247             TurnComponent = graph.getResourceByURI(URIs.TurnComponent);\r
248             TurnControlPoint = graph.getResourceByURI(URIs.TurnControlPoint);\r
249             UndirectedControlPoint = graph.getResourceByURI(URIs.UndirectedControlPoint);\r
250             VariableAngleTurnComponent = graph.getResourceByURI(URIs.VariableAngleTurnComponent);\r
251             VariableAngleTurnControlPoint = graph.getResourceByURI(URIs.VariableAngleTurnControlPoint);\r
252             VariableLengthControlPoint = graph.getResourceByURI(URIs.VariableLengthControlPoint);\r
253             VariableLengthInlineComponent = graph.getResourceByURI(URIs.VariableLengthInlineComponent);\r
254             VerticalVessel = graph.getResourceByURI(URIs.VerticalVessel);\r
255             Vessel = graph.getResourceByURI(URIs.Vessel);\r
256         } catch(ResourceNotFoundException e) {\r
257             throw new Layer0MissingException(e);\r
258         }\r
259     }\r
260     \r
261     public static Plant3DResource getInstance(Graph graph) {\r
262         Session session = graph.getSession();\r
263         Plant3DResource ret = session.getService(Plant3DResource.class);\r
264         if(ret == null) {\r
265             ret = new Plant3DResource(graph);\r
266             session.registerService(Plant3DResource.class, ret);\r
267         }\r
268         return ret;\r
269     }\r
270     \r
271 }\r
272 \r